Average Error: 3.8 → 1.6
Time: 4.9s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (t / ((double) (((double) (z * 3.0)) * y))))));
}
double code(double x, double y, double z, double t) {
	return ((double) (x + ((double) (((double) (((double) (((double) (t / z)) / 3.0)) / y)) - ((double) (y / ((double) (z * 3.0))))))));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original3.8
Target1.5
Herbie1.6
\[\]

Derivation

  1. Initial program 3.8

    \[\]
  2. Simplified3.8

    \[\leadsto \]
  3. Using strategy rm
  4. Applied *-un-lft-identity3.8

    \[\leadsto \]
  5. Applied times-frac1.6

    \[\leadsto \]
  6. Using strategy rm
  7. Applied associate-*l/1.5

    \[\leadsto \]
  8. Simplified1.5

    \[\leadsto \]
  9. Using strategy rm
  10. Applied associate-/r*1.6

    \[\leadsto \]
  11. Final simplification1.6

    \[\leadsto \]

Reproduce

herbie shell --seed 2020179 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

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

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