Average Error: 14.4 → 0.5
Time: 4.4s
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)) <= -inf.0)) {
		VAR = ((double) (((double) (y * x)) / z));
	} else {
		double VAR_1;
		if ((((double) (y / z)) <= -2.804420989472457e-172)) {
			VAR_1 = ((double) (((double) (y / z)) * x));
		} else {
			double VAR_2;
			if (((((double) (y / z)) <= 2.719780834364527e-272) || !(((double) (y / z)) <= 7.265617949894509e+189))) {
				VAR_2 = ((double) (y * ((double) (x / z))));
			} else {
				VAR_2 = ((double) (x / ((double) (z / y))));
			}
			VAR_1 = VAR_2;
		}
		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.3
Herbie0.5
\[\]

Derivation

  1. Split input into 4 regimes
  2. if (/ y z) < -inf.0

    1. Initial program 64.0

      \[\]
    2. Simplified64.0

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

      \[\leadsto \]

    if -inf.0 < (/ y z) < -2.8044209894724572e-172

    1. Initial program 9.4

      \[\]
    2. Simplified0.3

      \[\leadsto \]

    if -2.8044209894724572e-172 < (/ y z) < 2.719780834364527e-272 or 7.265617949894509e189 < (/ y z)

    1. Initial program 21.6

      \[\]
    2. Simplified13.5

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

      \[\leadsto \]
    5. Applied *-un-lft-identity13.9

      \[\leadsto \]
    6. Applied times-frac13.9

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

      \[\leadsto \]
    8. Simplified3.8

      \[\leadsto \]
    9. Taylor expanded around 0 0.5

      \[\leadsto \]
    10. Simplified0.9

      \[\leadsto \]

    if 2.719780834364527e-272 < (/ y z) < 7.265617949894509e189

    1. Initial program 8.7

      \[\]
    2. Simplified0.2

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

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

      \[\leadsto \]
  3. Recombined 4 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \]

Reproduce

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