Average Error: 6.5 → 2.0
Time: 4.8s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (x + ((double) (((double) (y * ((double) (z - x)))) / t))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((x <= -1.057502676775945e-226) || !(x <= 9.027701986314331e-242))) {
		VAR = ((double) (x + ((double) (((double) (z - x)) * ((double) (y / t))))));
	} else {
		VAR = ((double) (x + ((double) (((double) (((double) (((double) cbrt(y)) * ((double) cbrt(y)))) * ((double) (((double) (z - x)) * ((double) cbrt(y)))))) / t))));
	}
	return VAR;
}

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

Original6.5
Target2.0
Herbie2.0
\[\]

Derivation

  1. Split input into 2 regimes
  2. if x < -1.05750267677594508e-226 or 9.02770198631433139e-242 < x

    1. Initial program 6.7

      \[\]
    2. Using strategy rm
    3. Applied add-cube-cbrt7.1

      \[\leadsto \]
    4. Applied associate-/r*7.1

      \[\leadsto \]
    5. Simplified2.6

      \[\leadsto \]
    6. Using strategy rm
    7. Applied *-un-lft-identity2.6

      \[\leadsto \]
    8. Applied cbrt-prod2.6

      \[\leadsto \]
    9. Applied times-frac1.9

      \[\leadsto \]
    10. Simplified1.9

      \[\leadsto \]
    11. Simplified1.4

      \[\leadsto \]

    if -1.05750267677594508e-226 < x < 9.02770198631433139e-242

    1. Initial program 5.2

      \[\]
    2. Using strategy rm
    3. Applied add-cube-cbrt5.9

      \[\leadsto \]
    4. Applied associate-*l*6.0

      \[\leadsto \]
    5. Simplified6.0

      \[\leadsto \]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.0

    \[\leadsto \]

Reproduce

herbie shell --seed 2020180 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
  :precision binary64

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

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