Average Error: 12.3 → 3.3
Time: 1.8s
Precision: 64
\[\frac{x \cdot \left(y + z\right)}{z}\]
\[x \cdot \frac{y + z}{z}\]
\frac{x \cdot \left(y + z\right)}{z}
x \cdot \frac{y + z}{z}
double code(double x, double y, double z) {
	return ((double) (((double) (x * ((double) (y + z)))) / z));
}
double code(double x, double y, double z) {
	return ((double) (x * ((double) (((double) (y + z)) / 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

Original12.3
Target3.0
Herbie3.3
\[\frac{x}{\frac{z}{y + z}}\]

Derivation

  1. Initial program 12.3

    \[\frac{x \cdot \left(y + z\right)}{z}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity12.3

    \[\leadsto \frac{x \cdot \left(y + z\right)}{\color{blue}{1 \cdot z}}\]
  4. Applied times-frac3.3

    \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y + z}{z}}\]
  5. Simplified3.3

    \[\leadsto \color{blue}{x} \cdot \frac{y + z}{z}\]
  6. Final simplification3.3

    \[\leadsto x \cdot \frac{y + z}{z}\]

Reproduce

herbie shell --seed 2020114 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
  :precision binary64

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

  (/ (* x (+ y z)) z))