Average Error: 4.5 → 1.3
Time: 6.2s
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 (((((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z)))))) <= -inf.0) || !(((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z)))))) <= 7.802809014005588e+275))) {
		VAR = ((double) (((double) (x * ((double) (((double) (y * ((double) (1.0 - z)))) - ((double) (z * t)))))) / ((double) (z * ((double) (1.0 - z))))));
	} else {
		VAR = ((double) (((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z)))))) * x));
	}
	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.3
Herbie1.3
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (- (/ y z) (/ t (- 1.0 z))) < -inf.0 or 7.80280901400558829e275 < (- (/ y z) (/ t (- 1.0 z)))

    1. Initial program 49.6

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

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

      \[\leadsto \]

    if -inf.0 < (- (/ y z) (/ t (- 1.0 z))) < 7.80280901400558829e275

    1. Initial program 1.3

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

    \[\leadsto \]

Reproduce

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