Average Error: 10.5 → 0.0
Time: 3.4s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z) {
	return ((double) (((double) (x + ((double) (y * ((double) (z - x)))))) / z));
}
double code(double x, double y, double z) {
	return ((double) (y + ((double) (((double) (x / z)) - ((double) (y * ((double) (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.5
Target0.0
Herbie0.0
\[\]

Derivation

  1. Initial program 10.5

    \[\]
  2. Simplified3.4

    \[\leadsto \]
  3. Using strategy rm
  4. Applied associate-*r/3.7

    \[\leadsto \]
  5. Simplified3.7

    \[\leadsto \]
  6. Using strategy rm
  7. Applied div-sub3.7

    \[\leadsto \]
  8. Simplified0.0

    \[\leadsto \]
  9. Final simplification0.0

    \[\leadsto \]

Reproduce

herbie shell --seed 2020191 
(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))