Average Error: 3.6 → 2.1
Time: 9.3s
Precision: 64
\[\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)}}\]
\[\frac{x}{x + y \cdot e^{2 \cdot \left(\mathsf{fma}\left(z, \frac{\sqrt{t + a}}{t}, -\left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right) + \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right) \cdot \left(\left(-\left(b - c\right)\right) + \left(b - c\right)\right)\right)}}\]
\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)}}
\frac{x}{x + y \cdot e^{2 \cdot \left(\mathsf{fma}\left(z, \frac{\sqrt{t + a}}{t}, -\left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right) + \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right) \cdot \left(\left(-\left(b - c\right)\right) + \left(b - c\right)\right)\right)}}
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) {
	return (x / (x + (y * exp((2.0 * (fma(z, (sqrt((t + a)) / t), -((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))) + (((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))) * (-(b - c) + (b - c)))))))));
}

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.6
Target2.7
Herbie2.1
\[\begin{array}{l} \mathbf{if}\;t \lt -2.1183266448915811 \cdot 10^{-50}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(\left(a \cdot c + 0.83333333333333337 \cdot c\right) - a \cdot b\right)}}\\ \mathbf{elif}\;t \lt 5.19658877065154709 \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. 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. Using strategy rm
  3. Applied *-un-lft-identity3.6

    \[\leadsto \frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{\color{blue}{1 \cdot t}} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}\]
  4. Applied times-frac3.2

    \[\leadsto \frac{x}{x + y \cdot e^{2 \cdot \left(\color{blue}{\frac{z}{1} \cdot \frac{\sqrt{t + a}}{t}} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}\]
  5. Applied prod-diff22.0

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

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

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

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

Reproduce

herbie shell --seed 2020056 +o rules:numerics
(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 (- (+ (* a c) (* 0.8333333333333334 c)) (* a b))))))) (if (< t 5.196588770651547e-123) (/ x (+ x (* y (exp (* 2 (/ (- (* (* z (sqrt (+ t a))) (* (* 3 t) (- a (/ 5 6)))) (* (- (* (+ (/ 5 6) a) (* 3 t)) 2) (* (- a (/ 5 6)) (* (- b c) t)))) (* (* (* t t) 3) (- a (/ 5 6))))))))) (/ x (+ x (* y (exp (* 2 (- (/ (* z (sqrt (+ t a))) t) (* (- b c) (- (+ a (/ 5 6)) (/ 2 (* t 3))))))))))))

  (/ x (+ x (* y (exp (* 2 (- (/ (* z (sqrt (+ t a))) t) (* (- b c) (- (+ a (/ 5 6)) (/ 2 (* t 3)))))))))))