Average Error: 24.7 → 8.0
Time: 7.0s
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)))))) <= -7.624853213219643e-277) || !(((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z)))))) <= 3.305555106969341e-305))) {
		VAR = ((double) (x + ((double) (((double) (t - x)) * ((double) (((double) (y - z)) / ((double) (a - z))))))));
	} else {
		VAR = ((double) (t + ((double) (((double) (y / z)) * ((double) (x - t))))));
	}
	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.7
Target12.1
Herbie8.0
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (+ x (/ (* (- y z) (- t x)) (- a z))) < -7.6248532132196434e-277 or 3.30555510696934e-305 < (+ x (/ (* (- y z) (- t x)) (- a z)))

    1. Initial program 21.4

      \[\]
    2. Simplified10.5

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

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

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

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

      \[\leadsto \]
    8. Simplified8.1

      \[\leadsto \]
    9. Using strategy rm
    10. Applied pow18.1

      \[\leadsto \]
    11. Applied pow18.1

      \[\leadsto \]
    12. Applied pow-prod-down8.1

      \[\leadsto \]
    13. Simplified7.1

      \[\leadsto \]

    if -7.6248532132196434e-277 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 3.30555510696934e-305

    1. Initial program 59.1

      \[\]
    2. Simplified59.7

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

      \[\leadsto \]
    4. Simplified17.0

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

    \[\leadsto \]

Reproduce

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