Average Error: 1.9 → 2.7
Time: 9.1s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t, double a, double b) {
	return ((double) (((double) (x * ((double) exp(((double) (((double) (((double) (y * ((double) log(z)))) + ((double) (((double) (t - 1.0)) * ((double) log(a)))))) - b)))))) / y));
}
double code(double x, double y, double z, double t, double a, double b) {
	double VAR;
	if (((((double) (((double) (t - 1.0)) * ((double) log(a)))) <= -1093605437.1218257) || !(((double) (((double) (t - 1.0)) * ((double) log(a)))) <= 55.13562158933433))) {
		VAR = ((double) (((double) (x * ((double) pow(((double) M_E), ((double) (((double) (((double) (((double) (t - 1.0)) * ((double) log(a)))) + ((double) (y * ((double) log(z)))))) - b)))))) / y));
	} else {
		VAR = ((double) (x / ((double) (y * ((double) (((double) exp(b)) / ((double) (((double) pow(z, y)) * ((double) pow(a, ((double) (t - 1.0))))))))))));
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.9
Target10.3
Herbie2.7
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (* (- t 1.0) (log a)) < -1093605437.1218257 or 55.1356215893343276 < (* (- t 1.0) (log a))

    1. Initial program 0.5

      \[\]
    2. Using strategy rm
    3. Applied *-un-lft-identity0.5

      \[\leadsto \]
    4. Applied exp-prod0.5

      \[\leadsto \]
    5. Simplified0.5

      \[\leadsto \]

    if -1093605437.1218257 < (* (- t 1.0) (log a)) < 55.1356215893343276

    1. Initial program 5.2

      \[\]
    2. Using strategy rm
    3. Applied associate-/l*1.9

      \[\leadsto \]
    4. Simplified7.6

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020180 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (if (< t -0.8845848504127471) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1.0) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1.0))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1.0) (* y (log z))))))

  (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))