Average Error: 4.5 → 4.0
Time: 5.6s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (x * ((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z))))))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((z <= -4.146166835886616e-148) || !(z <= 1.530035490509503e-182))) {
		VAR = ((double) (((double) (x * ((double) (y / z)))) + ((double) (x / ((double) (((double) (z / t)) - ((double) (1.0 / t))))))));
	} else {
		VAR = ((double) (((double) (x * ((double) (((double) (y * ((double) (1.0 - z)))) - ((double) (z * t)))))) / ((double) (z * ((double) (1.0 - 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

Original4.5
Target4.1
Herbie4.0
\[\]

Derivation

  1. Split input into 2 regimes
  2. if z < -4.1461668358866157e-148 or 1.5300354905095031e-182 < z

    1. Initial program 2.9

      \[\]
    2. Using strategy rm
    3. Applied clear-num3.0

      \[\leadsto \]
    4. Using strategy rm
    5. Applied div-sub3.0

      \[\leadsto \]
    6. Using strategy rm
    7. Applied sub-neg3.0

      \[\leadsto \]
    8. Applied distribute-lft-in3.0

      \[\leadsto \]
    9. Simplified3.0

      \[\leadsto \]

    if -4.1461668358866157e-148 < z < 1.5300354905095031e-182

    1. Initial program 12.9

      \[\]
    2. Using strategy rm
    3. Applied frac-sub12.9

      \[\leadsto \]
    4. Applied associate-*r/8.9

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020191 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
  :precision binary64

  :herbie-target
  (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (neg (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))

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