Average Error: 14.4 → 3.2
Time: 3.5s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (x * ((double) (((double) (((double) (y / z)) * t)) / t))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((((double) (y / z)) <= -1.060217236360943e-70)) {
		VAR = ((double) (((double) (x / ((double) (((double) cbrt(z)) * ((double) cbrt(z)))))) * ((double) (y / ((double) cbrt(z))))));
	} else {
		double VAR_1;
		if (((((double) (y / z)) <= 5.974219343554618e-278) || !(((double) (y / z)) <= 1.1608024356072124e+107))) {
			VAR_1 = ((double) (((double) (y * x)) / z));
		} else {
			VAR_1 = ((double) (x / ((double) (z / y))));
		}
		VAR = VAR_1;
	}
	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

Original14.4
Target1.6
Herbie3.2
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (/ y z) < -1.06021723636094304e-70

    1. Initial program 15.3

      \[\]
    2. Simplified6.3

      \[\leadsto \]
    3. Using strategy rm
    4. Applied add-cube-cbrt7.3

      \[\leadsto \]
    5. Applied *-un-lft-identity7.3

      \[\leadsto \]
    6. Applied times-frac7.3

      \[\leadsto \]
    7. Applied associate-*r*7.6

      \[\leadsto \]
    8. Simplified7.6

      \[\leadsto \]

    if -1.06021723636094304e-70 < (/ y z) < 5.9742193435546183e-278 or 1.1608024356072124e107 < (/ y z)

    1. Initial program 19.0

      \[\]
    2. Simplified9.7

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

      \[\leadsto \]

    if 5.9742193435546183e-278 < (/ y z) < 1.1608024356072124e107

    1. Initial program 7.0

      \[\]
    2. Simplified0.2

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

      \[\leadsto \]
    5. Using strategy rm
    6. Applied associate-/l*0.2

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020192 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"
  :precision binary64

  :herbie-target
  (if (< (/ (* (/ y z) t) t) -1.20672205123045e+245) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) -5.907522236933906e-275) (* x (/ y z)) (if (< (/ (* (/ y z) t) t) 5.658954423153415e-65) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) 2.0087180502407133e+217) (* x (/ y z)) (/ (* y x) z)))))

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