Average Error: 7.0 → 2.0
Time: 21.1s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.038679537701190426521563963363797141776 \cdot 10^{-68}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{elif}\;t \le -2.343259671890845919694745995838773941708 \cdot 10^{-154}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \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.038679537701190426521563963363797141776 \cdot 10^{-68}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\

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

\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 r342636 = x;
        double r342637 = y;
        double r342638 = r342637 - r342636;
        double r342639 = z;
        double r342640 = r342638 * r342639;
        double r342641 = t;
        double r342642 = r342640 / r342641;
        double r342643 = r342636 + r342642;
        return r342643;
}

double f(double x, double y, double z, double t) {
        double r342644 = t;
        double r342645 = -1.0386795377011904e-68;
        bool r342646 = r342644 <= r342645;
        double r342647 = x;
        double r342648 = y;
        double r342649 = r342648 - r342647;
        double r342650 = r342649 / r342644;
        double r342651 = z;
        double r342652 = r342650 * r342651;
        double r342653 = r342647 + r342652;
        double r342654 = -2.343259671890846e-154;
        bool r342655 = r342644 <= r342654;
        double r342656 = r342644 / r342651;
        double r342657 = r342649 / r342656;
        double r342658 = r342647 + r342657;
        double r342659 = cbrt(r342649);
        double r342660 = r342659 * r342659;
        double r342661 = cbrt(r342651);
        double r342662 = r342661 * r342661;
        double r342663 = r342660 * r342662;
        double r342664 = r342644 / r342661;
        double r342665 = r342659 / r342664;
        double r342666 = r342663 * r342665;
        double r342667 = r342647 + r342666;
        double r342668 = r342655 ? r342658 : r342667;
        double r342669 = r342646 ? r342653 : r342668;
        return r342669;
}

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.0386795377011904e-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 *-un-lft-identity1.3

      \[\leadsto x + \color{blue}{1 \cdot \frac{y - x}{\frac{t}{z}}}\]
    6. Applied *-un-lft-identity1.3

      \[\leadsto \color{blue}{1 \cdot x} + 1 \cdot \frac{y - x}{\frac{t}{z}}\]
    7. Applied distribute-lft-out1.3

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

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

    if -1.0386795377011904e-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 associate-/l*3.1

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

    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.038679537701190426521563963363797141776 \cdot 10^{-68}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{elif}\;t \le -2.343259671890845919694745995838773941708 \cdot 10^{-154}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \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)))