Average Error: 0.0 → 0.0
Time: 16.1s
Precision: binary64
Cost: 320
\[x - y \cdot z\]
\[x - y \cdot z\]
x - y \cdot z
x - y \cdot z
(FPCore (x y z) :precision binary64 (- x (* y z)))
(FPCore (x y z) :precision binary64 (- x (* y z)))
double code(double x, double y, double z) {
	return x - (y * z);
}
double code(double x, double y, double z) {
	return x - (y * z);
}

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

Target

Original0.0
Target0.0
Herbie0.0
\[\frac{x + y \cdot z}{\frac{x + y \cdot z}{x - y \cdot z}}\]
Alternative 1
Accuracy1.4
Cost1280
\[\sqrt[3]{x - y \cdot z} \cdot \left(\sqrt[3]{x - y \cdot z} \cdot \sqrt[3]{x - y \cdot z}\right)\]
Alternative 2
Accuracy20.5
Cost1921
\[\begin{array}{l} \mathbf{if}\;x - y \cdot z \leq -1.3197954260617604 \cdot 10^{-159}:\\ \;\;\;\;\frac{{x}^{3} - {\left(y \cdot z\right)}^{3}}{x \cdot x + y \cdot \left(z \cdot \left(x + y \cdot z\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x - y \cdot z} \cdot \sqrt{x - y \cdot z}\\ \end{array}\]
Alternative 3
Accuracy40.8
Cost1472
\[\frac{{x}^{3} - {\left(y \cdot z\right)}^{3}}{x \cdot x + y \cdot \left(z \cdot \left(x + y \cdot z\right)\right)}\]

Derivation

  1. Initial program 0.0

    \[x - y \cdot z\]
  2. Using strategy rm
  3. Applied sub-neg_binary64_174620.0

    \[\leadsto \color{blue}{x + \left(-y \cdot z\right)}\]
  4. Using strategy rm
  5. Applied pow1_binary64_175300.0

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

    \[\leadsto x - y \cdot z\]

Reproduce

herbie shell --seed 2020322 
(FPCore (x y z)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, C"
  :precision binary64

  :herbie-target
  (/ (+ x (* y z)) (/ (+ x (* y z)) (- x (* y z))))

  (- x (* y z)))