Average Error: 14.7 → 0.8
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)) <= -3.4578441984957297e+136)) {
		VAR = ((double) (y * ((double) (x / z))));
	} else {
		double VAR_1;
		if ((((double) (y / z)) <= -2.994087309324921e-208)) {
			VAR_1 = ((double) (((double) (y / z)) * x));
		} else {
			double VAR_2;
			if ((((double) (y / z)) <= 4.221322586165302e-202)) {
				VAR_2 = ((double) (((double) (y * x)) / z));
			} else {
				double VAR_3;
				if ((((double) (y / z)) <= 4.614671660723258e+132)) {
					VAR_3 = ((double) (((double) (y / z)) * x));
				} else {
					VAR_3 = ((double) (y * ((double) (x / z))));
				}
				VAR_2 = VAR_3;
			}
			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.7
Target1.5
Herbie0.8
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (/ y z) < -3.4578441984957297e136 or 4.61467166072325781e132 < (/ y z)

    1. Initial program 32.5

      \[\]
    2. Simplified16.0

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

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

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

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

      \[\leadsto \]
    8. Simplified4.9

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

      \[\leadsto \]
    10. Simplified2.9

      \[\leadsto \]

    if -3.4578441984957297e136 < (/ y z) < -2.99408730932492112e-208 or 4.2213225861653017e-202 < (/ y z) < 4.61467166072325781e132

    1. Initial program 6.9

      \[\]
    2. Simplified0.2

      \[\leadsto \]

    if -2.99408730932492112e-208 < (/ y z) < 4.2213225861653017e-202

    1. Initial program 18.4

      \[\]
    2. Simplified11.4

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

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

    \[\leadsto \]

Reproduce

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