Average Error: 0.0 → 0.0
Time: 2.0s
Precision: binary64
\[x + \left(y - x\right) \cdot z\]
\[x + \sqrt[3]{-1} \cdot \left(x \cdot z - z \cdot y\right)\]
x + \left(y - x\right) \cdot z
x + \sqrt[3]{-1} \cdot \left(x \cdot z - z \cdot y\right)
double code(double x, double y, double z) {
	return ((double) (x + ((double) (((double) (y - x)) * z))));
}
double code(double x, double y, double z) {
	return ((double) (x + ((double) (((double) cbrt(-1.0)) * ((double) (((double) (x * z)) - ((double) (z * y))))))));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[x + \left(y - x\right) \cdot z\]
  2. Using strategy rm
  3. Applied add-cbrt-cube17.9

    \[\leadsto x + \left(y - x\right) \cdot \color{blue}{\sqrt[3]{\left(z \cdot z\right) \cdot z}}\]
  4. Applied add-cbrt-cube43.3

    \[\leadsto x + \color{blue}{\sqrt[3]{\left(\left(y - x\right) \cdot \left(y - x\right)\right) \cdot \left(y - x\right)}} \cdot \sqrt[3]{\left(z \cdot z\right) \cdot z}\]
  5. Applied cbrt-unprod45.1

    \[\leadsto x + \color{blue}{\sqrt[3]{\left(\left(\left(y - x\right) \cdot \left(y - x\right)\right) \cdot \left(y - x\right)\right) \cdot \left(\left(z \cdot z\right) \cdot z\right)}}\]
  6. Simplified26.8

    \[\leadsto x + \sqrt[3]{\color{blue}{{\left(\left(y - x\right) \cdot z\right)}^{3}}}\]
  7. Taylor expanded around -inf 0.0

    \[\leadsto \color{blue}{\left(x + \sqrt[3]{-1} \cdot \left(x \cdot z\right)\right) - \sqrt[3]{-1} \cdot \left(z \cdot y\right)}\]
  8. Simplified0.0

    \[\leadsto \color{blue}{x + \sqrt[3]{-1} \cdot \left(x \cdot z - z \cdot y\right)}\]
  9. Final simplification0.0

    \[\leadsto x + \sqrt[3]{-1} \cdot \left(x \cdot z - z \cdot y\right)\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x y z)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, B"
  :precision binary64
  (+ x (* (- y x) z)))