Average Error: 7.0 → 2.0
Time: 23.2s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.07912094098921713344693251944234170586 \cdot 10^{-68}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{elif}\;t \le -2.343259671890845919694745995838773941708 \cdot 10^{-154}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right) \cdot \frac{\sqrt[3]{y - x}}{\frac{t}{\sqrt[3]{z}}}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot z}{t}
\begin{array}{l}
\mathbf{if}\;t \le -1.07912094098921713344693251944234170586 \cdot 10^{-68}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\

\mathbf{elif}\;t \le -2.343259671890845919694745995838773941708 \cdot 10^{-154}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right) \cdot \frac{\sqrt[3]{y - x}}{\frac{t}{\sqrt[3]{z}}}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r1019578 = x;
        double r1019579 = y;
        double r1019580 = r1019579 - r1019578;
        double r1019581 = z;
        double r1019582 = r1019580 * r1019581;
        double r1019583 = t;
        double r1019584 = r1019582 / r1019583;
        double r1019585 = r1019578 + r1019584;
        return r1019585;
}

double f(double x, double y, double z, double t) {
        double r1019586 = t;
        double r1019587 = -1.0791209409892171e-68;
        bool r1019588 = r1019586 <= r1019587;
        double r1019589 = x;
        double r1019590 = y;
        double r1019591 = r1019590 - r1019589;
        double r1019592 = r1019591 / r1019586;
        double r1019593 = z;
        double r1019594 = r1019592 * r1019593;
        double r1019595 = r1019589 + r1019594;
        double r1019596 = -2.343259671890846e-154;
        bool r1019597 = r1019586 <= r1019596;
        double r1019598 = r1019593 / r1019586;
        double r1019599 = r1019591 * r1019598;
        double r1019600 = r1019589 + r1019599;
        double r1019601 = cbrt(r1019591);
        double r1019602 = r1019601 * r1019601;
        double r1019603 = cbrt(r1019593);
        double r1019604 = r1019603 * r1019603;
        double r1019605 = r1019602 * r1019604;
        double r1019606 = r1019586 / r1019603;
        double r1019607 = r1019601 / r1019606;
        double r1019608 = r1019605 * r1019607;
        double r1019609 = r1019589 + r1019608;
        double r1019610 = r1019597 ? r1019600 : r1019609;
        double r1019611 = r1019588 ? r1019595 : r1019610;
        return r1019611;
}

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

Original7.0
Target2.0
Herbie2.0
\[\begin{array}{l} \mathbf{if}\;x \lt -9.025511195533004570453352523209034680317 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\ \mathbf{elif}\;x \lt 4.275032163700714748507147332551979944314 \cdot 10^{-250}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if t < -1.0791209409892171e-68

    1. Initial program 9.0

      \[x + \frac{\left(y - x\right) \cdot z}{t}\]
    2. Using strategy rm
    3. Applied associate-/l*1.3

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
    4. Using strategy rm
    5. Applied associate-/r/1.6

      \[\leadsto x + \color{blue}{\frac{y - x}{t} \cdot z}\]

    if -1.0791209409892171e-68 < t < -2.343259671890846e-154

    1. Initial program 0.9

      \[x + \frac{\left(y - x\right) \cdot z}{t}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity0.9

      \[\leadsto x + \frac{\left(y - x\right) \cdot z}{\color{blue}{1 \cdot t}}\]
    4. Applied times-frac3.2

      \[\leadsto x + \color{blue}{\frac{y - x}{1} \cdot \frac{z}{t}}\]
    5. Simplified3.2

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

    if -2.343259671890846e-154 < t

    1. Initial program 6.4

      \[x + \frac{\left(y - x\right) \cdot z}{t}\]
    2. Using strategy rm
    3. Applied associate-/l*2.1

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt2.7

      \[\leadsto x + \frac{y - x}{\frac{t}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}}\]
    6. Applied *-un-lft-identity2.7

      \[\leadsto x + \frac{y - x}{\frac{\color{blue}{1 \cdot t}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}\]
    7. Applied times-frac2.7

      \[\leadsto x + \frac{y - x}{\color{blue}{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{t}{\sqrt[3]{z}}}}\]
    8. Applied add-cube-cbrt2.8

      \[\leadsto x + \frac{\color{blue}{\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \sqrt[3]{y - x}}}{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{t}{\sqrt[3]{z}}}\]
    9. Applied times-frac2.1

      \[\leadsto x + \color{blue}{\frac{\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}}{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{\sqrt[3]{y - x}}{\frac{t}{\sqrt[3]{z}}}}\]
    10. Simplified2.1

      \[\leadsto x + \color{blue}{\left(\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right)} \cdot \frac{\sqrt[3]{y - x}}{\frac{t}{\sqrt[3]{z}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.07912094098921713344693251944234170586 \cdot 10^{-68}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{elif}\;t \le -2.343259671890845919694745995838773941708 \cdot 10^{-154}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right) \cdot \frac{\sqrt[3]{y - x}}{\frac{t}{\sqrt[3]{z}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019303 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< x -9.0255111955330046e-135) (- x (* (/ z t) (- x y))) (if (< x 4.2750321637007147e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))

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