Average Error: 24.1 → 9.2
Time: 6.1s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= -3.0127902801780714e-287)) {
		VAR = ((double) (x + ((double) (((double) (((double) (((double) (y - z)) / ((double) (((double) cbrt(((double) (a - z)))) * ((double) cbrt(((double) (a - z)))))))) * ((double) (((double) cbrt(((double) (t - x)))) * ((double) cbrt(((double) (t - x)))))))) * ((double) (((double) cbrt(((double) (t - x)))) / ((double) cbrt(((double) (a - z))))))))));
	} else {
		double VAR_1;
		if ((((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= 0.0)) {
			VAR_1 = ((double) (t + ((double) (y * ((double) (((double) (x / z)) - ((double) (t / z))))))));
		} else {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (y - z)) / ((double) (((double) cbrt(((double) (a - z)))) * ((double) cbrt(((double) (a - z)))))))) * ((double) (((double) (t - x)) / ((double) cbrt(((double) (a - z))))))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original24.1
Target12.0
Herbie9.2
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (+ x (/ (* (- y z) (- t x)) (- a z))) < -3.0127902801780714e-287

    1. Initial program 21.0

      \[\]
    2. Simplified10.7

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

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

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

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

      \[\leadsto \]
    8. Simplified8.2

      \[\leadsto \]
    9. Using strategy rm
    10. Applied *-un-lft-identity8.2

      \[\leadsto \]
    11. Applied add-cube-cbrt8.4

      \[\leadsto \]
    12. Applied times-frac8.4

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

      \[\leadsto \]
    14. Simplified7.6

      \[\leadsto \]

    if -3.0127902801780714e-287 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 0.0

    1. Initial program 59.6

      \[\]
    2. Simplified59.7

      \[\leadsto \]
    3. Taylor expanded around inf 20.1

      \[\leadsto \]
    4. Simplified22.9

      \[\leadsto \]

    if 0.0 < (+ x (/ (* (- y z) (- t x)) (- a z)))

    1. Initial program 20.7

      \[\]
    2. Simplified10.1

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

      \[\leadsto \]
    5. Applied *-un-lft-identity10.8

      \[\leadsto \]
    6. Applied times-frac10.8

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

      \[\leadsto \]
    8. Simplified8.2

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020192 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

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