Average Error: 3.5 → 1.4
Time: 28.3s
Precision: binary64
\[\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}\]
\[\begin{array}{l} \mathbf{if}\;\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{2}{t \cdot 3}\right) \leq \infty:\\ \;\;\;\;\frac{x}{x + y \cdot {\left(e^{2}\right)}^{\log \left(e^{\sqrt{t + a} \cdot \frac{z}{t} - \left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y \cdot {\left(e^{2}\right)}^{\log \left(e^{\left(a + 0.8333333333333334\right) \cdot \left(c - b\right)}\right)}}\\ \end{array}\]
\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{2}{t \cdot 3}\right) \leq \infty:\\
\;\;\;\;\frac{x}{x + y \cdot {\left(e^{2}\right)}^{\log \left(e^{\sqrt{t + a} \cdot \frac{z}{t} - \left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot {\left(e^{2}\right)}^{\log \left(e^{\left(a + 0.8333333333333334\right) \cdot \left(c - b\right)}\right)}}\\

\end{array}
(FPCore (x y z t a b c)
 :precision binary64
 (/
  x
  (+
   x
   (*
    y
    (exp
     (*
      2.0
      (-
       (/ (* z (sqrt (+ t a))) t)
       (* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))))))
(FPCore (x y z t a b c)
 :precision binary64
 (if (<=
      (-
       (/ (* z (sqrt (+ t a))) t)
       (* (- b c) (- (+ a 0.8333333333333334) (/ 2.0 (* t 3.0)))))
      INFINITY)
   (/
    x
    (+
     x
     (*
      y
      (pow
       (exp 2.0)
       (log
        (exp
         (-
          (* (sqrt (+ t a)) (/ z t))
          (*
           (- b c)
           (- (+ a 0.8333333333333334) (/ 0.6666666666666666 t))))))))))
   (/
    x
    (+
     x
     (* y (pow (exp 2.0) (log (exp (* (+ a 0.8333333333333334) (- c b))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return x / (x + (y * exp(2.0 * (((z * sqrt(t + a)) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))))));
}
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((((z * sqrt(t + a)) / t) - ((b - c) * ((a + 0.8333333333333334) - (2.0 / (t * 3.0))))) <= ((double) INFINITY)) {
		tmp = x / (x + (y * pow(exp(2.0), log(exp((sqrt(t + a) * (z / t)) - ((b - c) * ((a + 0.8333333333333334) - (0.6666666666666666 / t))))))));
	} else {
		tmp = x / (x + (y * pow(exp(2.0), log(exp((a + 0.8333333333333334) * (c - b))))));
	}
	return tmp;
}

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

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original3.5
Target3.0
Herbie1.4
\[\begin{array}{l} \mathbf{if}\;t < -2.118326644891581 \cdot 10^{-50}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(\left(a \cdot c + 0.8333333333333334 \cdot c\right) - a \cdot b\right)}}\\ \mathbf{elif}\;t < 5.196588770651547 \cdot 10^{-123}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \frac{\left(z \cdot \sqrt{t + a}\right) \cdot \left(\left(3 \cdot t\right) \cdot \left(a - \frac{5}{6}\right)\right) - \left(\left(\frac{5}{6} + a\right) \cdot \left(3 \cdot t\right) - 2\right) \cdot \left(\left(a - \frac{5}{6}\right) \cdot \left(\left(b - c\right) \cdot t\right)\right)}{\left(\left(t \cdot t\right) \cdot 3\right) \cdot \left(a - \frac{5}{6}\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 5 6)) (/.f64 2 (*.f64 t 3))))) < +inf.0

    1. Initial program 0.7

      \[\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}\]
    2. Simplified0.7

      \[\leadsto \color{blue}{\frac{x}{x + y \cdot {\left(e^{2}\right)}^{\left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)\right)}}}\]
    3. Using strategy rm
    4. Applied add-log-exp_binary64_96655.2

      \[\leadsto \frac{x}{x + y \cdot {\left(e^{2}\right)}^{\left(\frac{z \cdot \sqrt{t + a}}{t} - \color{blue}{\log \left(e^{\left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}\right)}\right)}}\]
    5. Applied add-log-exp_binary64_966513.8

      \[\leadsto \frac{x}{x + y \cdot {\left(e^{2}\right)}^{\left(\color{blue}{\log \left(e^{\frac{z \cdot \sqrt{t + a}}{t}}\right)} - \log \left(e^{\left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}\right)\right)}}\]
    6. Applied diff-log_binary64_971813.8

      \[\leadsto \frac{x}{x + y \cdot {\left(e^{2}\right)}^{\color{blue}{\log \left(\frac{e^{\frac{z \cdot \sqrt{t + a}}{t}}}{e^{\left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}}\right)}}}\]
    7. Simplified0.4

      \[\leadsto \frac{x}{x + y \cdot {\left(e^{2}\right)}^{\log \color{blue}{\left(e^{\frac{z}{t} \cdot \sqrt{t + a} - \left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}\right)}}}\]

    if +inf.0 < (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 5 6)) (/.f64 2 (*.f64 t 3)))))

    1. Initial program 64.0

      \[\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}\]
    2. Simplified64.0

      \[\leadsto \color{blue}{\frac{x}{x + y \cdot {\left(e^{2}\right)}^{\left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)\right)}}}\]
    3. Using strategy rm
    4. Applied add-log-exp_binary64_966564.0

      \[\leadsto \frac{x}{x + y \cdot {\left(e^{2}\right)}^{\left(\frac{z \cdot \sqrt{t + a}}{t} - \color{blue}{\log \left(e^{\left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}\right)}\right)}}\]
    5. Applied add-log-exp_binary64_966564.0

      \[\leadsto \frac{x}{x + y \cdot {\left(e^{2}\right)}^{\left(\color{blue}{\log \left(e^{\frac{z \cdot \sqrt{t + a}}{t}}\right)} - \log \left(e^{\left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}\right)\right)}}\]
    6. Applied diff-log_binary64_971864.0

      \[\leadsto \frac{x}{x + y \cdot {\left(e^{2}\right)}^{\color{blue}{\log \left(\frac{e^{\frac{z \cdot \sqrt{t + a}}{t}}}{e^{\left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}}\right)}}}\]
    7. Simplified50.6

      \[\leadsto \frac{x}{x + y \cdot {\left(e^{2}\right)}^{\log \color{blue}{\left(e^{\frac{z}{t} \cdot \sqrt{t + a} - \left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}\right)}}}\]
    8. Taylor expanded around inf 27.5

      \[\leadsto \frac{x}{x + y \cdot {\left(e^{2}\right)}^{\log \left(e^{\color{blue}{\left(a \cdot c + 0.8333333333333334 \cdot c\right) - \left(a \cdot b + 0.8333333333333334 \cdot b\right)}}\right)}}\]
    9. Simplified24.1

      \[\leadsto \frac{x}{x + y \cdot {\left(e^{2}\right)}^{\log \left(e^{\color{blue}{\left(a + 0.8333333333333334\right) \cdot \left(c - b\right)}}\right)}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{2}{t \cdot 3}\right) \leq \infty:\\ \;\;\;\;\frac{x}{x + y \cdot {\left(e^{2}\right)}^{\log \left(e^{\sqrt{t + a} \cdot \frac{z}{t} - \left(b - c\right) \cdot \left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\right)}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y \cdot {\left(e^{2}\right)}^{\log \left(e^{\left(a + 0.8333333333333334\right) \cdot \left(c - b\right)}\right)}}\\ \end{array}\]

Reproduce

herbie shell --seed 2021093 
(FPCore (x y z t a b c)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, I"
  :precision binary64

  :herbie-target
  (if (< t -2.118326644891581e-50) (/ x (+ x (* y (exp (* 2.0 (- (+ (* a c) (* 0.8333333333333334 c)) (* a b))))))) (if (< t 5.196588770651547e-123) (/ x (+ x (* y (exp (* 2.0 (/ (- (* (* z (sqrt (+ t a))) (* (* 3.0 t) (- a (/ 5.0 6.0)))) (* (- (* (+ (/ 5.0 6.0) a) (* 3.0 t)) 2.0) (* (- a (/ 5.0 6.0)) (* (- b c) t)))) (* (* (* t t) 3.0) (- a (/ 5.0 6.0))))))))) (/ x (+ x (* y (exp (* 2.0 (- (/ (* z (sqrt (+ t a))) t) (* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))))))))

  (/ x (+ x (* y (exp (* 2.0 (- (/ (* z (sqrt (+ t a))) t) (* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))))))