Average Error: 10.1 → 3.5
Time: 2.5s
Precision: binary64
\[\frac{x + y \cdot \left(z - x\right)}{z}\]
\[y - \frac{y \cdot x - x}{z}\]
\frac{x + y \cdot \left(z - x\right)}{z}
y - \frac{y \cdot x - x}{z}
(FPCore (x y z) :precision binary64 (/ (+ x (* y (- z x))) z))
(FPCore (x y z) :precision binary64 (- y (/ (- (* y x) x) z)))
double code(double x, double y, double z) {
	return (((double) (x + ((double) (y * ((double) (z - x)))))) / z);
}
double code(double x, double y, double z) {
	return ((double) (y - (((double) (((double) (y * x)) - x)) / 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

Original10.1
Target0.0
Herbie3.5
\[\left(y + \frac{x}{z}\right) - \frac{y}{\frac{z}{x}}\]

Derivation

  1. Initial program 10.1

    \[\frac{x + y \cdot \left(z - x\right)}{z}\]
  2. Taylor expanded around 0 3.5

    \[\leadsto \color{blue}{\left(\frac{x}{z} + y\right) - \frac{x \cdot y}{z}}\]
  3. Simplified3.5

    \[\leadsto \color{blue}{y - \frac{x \cdot y - x}{z}}\]
  4. Final simplification3.5

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

Reproduce

herbie shell --seed 2020210 
(FPCore (x y z)
  :name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"
  :precision binary64

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

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