Average Error: 4.5 → 7.2
Time: 10.1s
Precision: 64
\[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
\[\frac{y \cdot x}{z} - \frac{t \cdot x}{1 - z}\]
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\frac{y \cdot x}{z} - \frac{t \cdot x}{1 - z}
double f(double x, double y, double z, double t) {
        double r296161 = x;
        double r296162 = y;
        double r296163 = z;
        double r296164 = r296162 / r296163;
        double r296165 = t;
        double r296166 = 1.0;
        double r296167 = r296166 - r296163;
        double r296168 = r296165 / r296167;
        double r296169 = r296164 - r296168;
        double r296170 = r296161 * r296169;
        return r296170;
}

double f(double x, double y, double z, double t) {
        double r296171 = y;
        double r296172 = x;
        double r296173 = r296171 * r296172;
        double r296174 = z;
        double r296175 = r296173 / r296174;
        double r296176 = t;
        double r296177 = r296176 * r296172;
        double r296178 = 1.0;
        double r296179 = r296178 - r296174;
        double r296180 = r296177 / r296179;
        double r296181 = r296175 - r296180;
        return r296181;
}

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.2
Herbie7.2
\[\begin{array}{l} \mathbf{if}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \lt -7.623226303312042442144691872793570510727 \cdot 10^{-196}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\ \mathbf{elif}\;x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \lt 1.413394492770230216018398633584271456447 \cdot 10^{-211}:\\ \;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if x < -4.3520223404451874e+135 or 3.262047267833346e+162 < x

    1. Initial program 4.1

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt5.1

      \[\leadsto x \cdot \color{blue}{\left(\left(\sqrt[3]{\frac{y}{z} - \frac{t}{1 - z}} \cdot \sqrt[3]{\frac{y}{z} - \frac{t}{1 - z}}\right) \cdot \sqrt[3]{\frac{y}{z} - \frac{t}{1 - z}}\right)}\]
    4. Applied associate-*r*5.1

      \[\leadsto \color{blue}{\left(x \cdot \left(\sqrt[3]{\frac{y}{z} - \frac{t}{1 - z}} \cdot \sqrt[3]{\frac{y}{z} - \frac{t}{1 - z}}\right)\right) \cdot \sqrt[3]{\frac{y}{z} - \frac{t}{1 - z}}}\]

    if -4.3520223404451874e+135 < x < 3.262047267833346e+162

    1. Initial program 4.6

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\]
    2. Using strategy rm
    3. Applied sub-neg4.6

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} + \left(-\frac{t}{1 - z}\right)\right)}\]
    4. Applied distribute-rgt-in4.6

      \[\leadsto \color{blue}{\frac{y}{z} \cdot x + \left(-\frac{t}{1 - z}\right) \cdot x}\]
    5. Using strategy rm
    6. Applied associate-*l/3.2

      \[\leadsto \color{blue}{\frac{y \cdot x}{z}} + \left(-\frac{t}{1 - z}\right) \cdot x\]
    7. Using strategy rm
    8. Applied distribute-neg-frac3.2

      \[\leadsto \frac{y \cdot x}{z} + \color{blue}{\frac{-t}{1 - z}} \cdot x\]
    9. Applied associate-*l/4.1

      \[\leadsto \frac{y \cdot x}{z} + \color{blue}{\frac{\left(-t\right) \cdot x}{1 - z}}\]
    10. Simplified4.1

      \[\leadsto \frac{y \cdot x}{z} + \frac{\color{blue}{-t \cdot x}}{1 - z}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification7.2

    \[\leadsto \frac{y \cdot x}{z} - \frac{t \cdot x}{1 - z}\]

Reproduce

herbie shell --seed 2019291 
(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 z)))) -7.62322630331204244e-196) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 1.41339449277023022e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z)))))))

  (* x (- (/ y z) (/ t (- 1 z)))))