# Description

System Information
Operating system and graphics card

Blender Version
Broken: 75381ae
Worked: (optional)

Short description of error
Math Result in Cycles Nodes is not correct or way not exact.

The exact same calculation done in Libre office, GeoGebra and Calculator yields in the correct Value of 1.45

Blender Result is 1.42345

Formula: IOR = (-R -2 sqrt(R)-1)/(R-1)
Libre Office Formula: =((0.0338*-1)-2 * SQRT(0.0338)-1)/(0.0338-1)

I know i do work with quite low Numbers, but since Colors are Linear in Blender and i think it is essential being able to do Math on those i do see this as a big Problem.

Or am i doing something Wrong here?

Exact steps for others to reproduce the error
Open Bug_MathCycles.blend
Hit Render
Check Color in Render Result
Check Math Result on your own if you like

# Details

Type
Bug

### Event Timeline

The node formula is not identical to the Libre Office formula.

Libre Office: (-R - SQRT(2)*R - 1)/(R - 1) = 1.45

Blender Nodes: ((-R - 2)*SQRT(2) - 1)/(R-1) = 1.42

In Libre Office you're multiplying the SQRT(2) by R, in Blender SQRT(2) is multiplying (-R-2)

hmm. Something isn't right on my side.

I'm sorry. Please close this Bug Report.

I will next time check better before reporting here.

Thanks Rob.

Where is the SQRT(2) in the original formula?

Blender:

((-R - 2) * SQRT(R)-1)/(R-1) = 1.42

Libre Office: (R*-1) == -R, so:

(-R - 2 * SQRT(R)-1)/(R-1) = 1.45

Only a parenthesis pair was missing :)

Bastien Montagne (mont29) claimed this task.