Average Error: 3.9 → 2.0
Time: 9.2s
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}\;t \leq -1.2797425918545752 \cdot 10^{-118}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(c, 0.8333333333333334 + a, \mathsf{fma}\left(\frac{0.6666666666666666}{t}, b - c, b \cdot \left(-0.8333333333333334 - a\right)\right)\right)\right)}, x\right)}\\ \mathbf{elif}\;t \leq 2.9706712496914734 \cdot 10^{-292}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\frac{\mathsf{fma}\left(0.6666666666666666, b, \mathsf{fma}\left(\sqrt{a}, z, c \cdot -0.6666666666666666\right)\right)}{t}\right)}, x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(\left(0.8333333333333334 + a\right) - \frac{0.6666666666666666}{t}, c - b, \frac{z}{t} \cdot \sqrt{t + a}\right)\right)}, x\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}\;t \leq -1.2797425918545752 \cdot 10^{-118}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(c, 0.8333333333333334 + a, \mathsf{fma}\left(\frac{0.6666666666666666}{t}, b - c, b \cdot \left(-0.8333333333333334 - a\right)\right)\right)\right)}, x\right)}\\

\mathbf{elif}\;t \leq 2.9706712496914734 \cdot 10^{-292}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\frac{\mathsf{fma}\left(0.6666666666666666, b, \mathsf{fma}\left(\sqrt{a}, z, c \cdot -0.6666666666666666\right)\right)}{t}\right)}, x\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(\left(0.8333333333333334 + a\right) - \frac{0.6666666666666666}{t}, c - b, \frac{z}{t} \cdot \sqrt{t + a}\right)\right)}, x\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 (<= t -1.2797425918545752e-118)
   (/
    x
    (fma
     y
     (pow
      (exp 2.0)
      (fma
       c
       (+ 0.8333333333333334 a)
       (fma (/ 0.6666666666666666 t) (- b c) (* b (- -0.8333333333333334 a)))))
     x))
   (if (<= t 2.9706712496914734e-292)
     (/
      x
      (fma
       y
       (pow
        (exp 2.0)
        (/
         (fma 0.6666666666666666 b (fma (sqrt a) z (* c -0.6666666666666666)))
         t))
       x))
     (/
      x
      (fma
       y
       (pow
        (exp 2.0)
        (fma
         (- (+ 0.8333333333333334 a) (/ 0.6666666666666666 t))
         (- c b)
         (* (/ z t) (sqrt (+ t a)))))
       x)))))
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 (t <= -1.2797425918545752e-118) {
		tmp = x / fma(y, pow(exp(2.0), fma(c, (0.8333333333333334 + a), fma((0.6666666666666666 / t), (b - c), (b * (-0.8333333333333334 - a))))), x);
	} else if (t <= 2.9706712496914734e-292) {
		tmp = x / fma(y, pow(exp(2.0), (fma(0.6666666666666666, b, fma(sqrt(a), z, (c * -0.6666666666666666))) / t)), x);
	} else {
		tmp = x / fma(y, pow(exp(2.0), fma(((0.8333333333333334 + a) - (0.6666666666666666 / t)), (c - b), ((z / t) * sqrt(t + a)))), x);
	}
	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

Target

Original3.9
Target3.0
Herbie2.0
\[\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 3 regimes
  2. if t < -1.2797425918545752e-118

    1. Initial program 3.6

      \[\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. Simplified3.1

      \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}, c - b, \frac{z \cdot \sqrt{t + a}}{t}\right)\right)}, x\right)}} \]
    3. Taylor expanded in a around 0 64.0

      \[\leadsto \frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}, c - b, \color{blue}{\sqrt{\frac{1}{t}} \cdot z}\right)\right)}, x\right)} \]
    4. Taylor expanded in z around 0 9.5

      \[\leadsto \frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\color{blue}{\left(\left(0.8333333333333334 \cdot c + \left(c \cdot a + 0.6666666666666666 \cdot \frac{b}{t}\right)\right) - \left(a \cdot b + \left(0.8333333333333334 \cdot b + 0.6666666666666666 \cdot \frac{c}{t}\right)\right)\right)}}, x\right)} \]
    5. Simplified7.6

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

    if -1.2797425918545752e-118 < t < 2.97067124969147339e-292

    1. Initial program 8.4

      \[\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. Simplified4.6

      \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}, c - b, \frac{z \cdot \sqrt{t + a}}{t}\right)\right)}, x\right)}} \]
    3. Taylor expanded in z around 0 5.7

      \[\leadsto \frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}, c - b, \color{blue}{\frac{z}{t} \cdot \sqrt{a + t}}\right)\right)}, x\right)} \]
    4. Taylor expanded in t around 0 0.6

      \[\leadsto \frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\color{blue}{\left(\frac{\left(0.6666666666666666 \cdot b + \sqrt{a} \cdot z\right) - 0.6666666666666666 \cdot c}{t}\right)}}, x\right)} \]
    5. Simplified0.6

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

    if 2.97067124969147339e-292 < t

    1. Initial program 3.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. Simplified2.2

      \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}, c - b, \frac{z \cdot \sqrt{t + a}}{t}\right)\right)}, x\right)}} \]
    3. Taylor expanded in z around 0 1.3

      \[\leadsto \frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(\left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}, c - b, \color{blue}{\frac{z}{t} \cdot \sqrt{a + t}}\right)\right)}, x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2797425918545752 \cdot 10^{-118}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(c, 0.8333333333333334 + a, \mathsf{fma}\left(\frac{0.6666666666666666}{t}, b - c, b \cdot \left(-0.8333333333333334 - a\right)\right)\right)\right)}, x\right)}\\ \mathbf{elif}\;t \leq 2.9706712496914734 \cdot 10^{-292}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\frac{\mathsf{fma}\left(0.6666666666666666, b, \mathsf{fma}\left(\sqrt{a}, z, c \cdot -0.6666666666666666\right)\right)}{t}\right)}, x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(\left(0.8333333333333334 + a\right) - \frac{0.6666666666666666}{t}, c - b, \frac{z}{t} \cdot \sqrt{t + a}\right)\right)}, x\right)}\\ \end{array} \]

Reproduce

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