Average Error: 11.6 → 2.4
Time: 4.0s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x * ((double) (y - z)))) / ((double) (t - z))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((z <= -9.586446773513064e-40) || !(z <= 1.5088456049136073e-288))) {
		VAR = ((double) (x * ((double) (1.0 / ((double) (((double) (t - z)) / ((double) (y - z))))))));
	} else {
		VAR = ((double) (((double) (x / ((double) (t - z)))) * ((double) (1.0 / ((double) (1.0 / ((double) (y - z))))))));
	}
	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

Original11.6
Target2.2
Herbie2.4
\[\]

Derivation

  1. Split input into 2 regimes
  2. if z < -9.58644677351306357e-40 or 1.5088456049136073e-288 < z

    1. Initial program 13.3

      \[\]
    2. Simplified1.5

      \[\leadsto \]
    3. Using strategy rm
    4. Applied clear-num1.6

      \[\leadsto \]

    if -9.58644677351306357e-40 < z < 1.5088456049136073e-288

    1. Initial program 5.8

      \[\]
    2. Simplified4.8

      \[\leadsto \]
    3. Using strategy rm
    4. Applied clear-num5.1

      \[\leadsto \]
    5. Using strategy rm
    6. Applied div-inv5.2

      \[\leadsto \]
    7. Applied *-un-lft-identity5.2

      \[\leadsto \]
    8. Applied times-frac4.9

      \[\leadsto \]
    9. Applied associate-*r*5.3

      \[\leadsto \]
    10. Simplified5.2

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020190 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (/ x (/ (- t z) (- y z)))

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