Average Error: 6.3 → 1.8
Time: 19.7s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -3.298192410539117391724374705141303330513 \cdot 10^{-118}:\\ \;\;\;\;x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\\ \mathbf{elif}\;t \le 5430407.937503213994204998016357421875:\\ \;\;\;\;x + \frac{1}{\frac{t}{\left(y - x\right) \cdot z}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{y - x}{t}}{\frac{1}{z}}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot z}{t}
\begin{array}{l}
\mathbf{if}\;t \le -3.298192410539117391724374705141303330513 \cdot 10^{-118}:\\
\;\;\;\;x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\\

\mathbf{elif}\;t \le 5430407.937503213994204998016357421875:\\
\;\;\;\;x + \frac{1}{\frac{t}{\left(y - x\right) \cdot z}}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y - x}{t}}{\frac{1}{z}}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r427644 = x;
        double r427645 = y;
        double r427646 = r427645 - r427644;
        double r427647 = z;
        double r427648 = r427646 * r427647;
        double r427649 = t;
        double r427650 = r427648 / r427649;
        double r427651 = r427644 + r427650;
        return r427651;
}

double f(double x, double y, double z, double t) {
        double r427652 = t;
        double r427653 = -3.2981924105391174e-118;
        bool r427654 = r427652 <= r427653;
        double r427655 = x;
        double r427656 = y;
        double r427657 = r427656 - r427655;
        double r427658 = cbrt(r427652);
        double r427659 = r427658 * r427658;
        double r427660 = r427657 / r427659;
        double r427661 = z;
        double r427662 = r427661 / r427658;
        double r427663 = r427660 * r427662;
        double r427664 = r427655 + r427663;
        double r427665 = 5430407.937503214;
        bool r427666 = r427652 <= r427665;
        double r427667 = 1.0;
        double r427668 = r427657 * r427661;
        double r427669 = r427652 / r427668;
        double r427670 = r427667 / r427669;
        double r427671 = r427655 + r427670;
        double r427672 = r427657 / r427652;
        double r427673 = r427667 / r427661;
        double r427674 = r427672 / r427673;
        double r427675 = r427655 + r427674;
        double r427676 = r427666 ? r427671 : r427675;
        double r427677 = r427654 ? r427664 : r427676;
        return r427677;
}

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

Original6.3
Target2.0
Herbie1.8
\[\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 < -3.2981924105391174e-118

    1. Initial program 7.1

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

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

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

      \[\leadsto x + \color{blue}{\left(y - x\right)} \cdot \frac{z}{t}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt1.7

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

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

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

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

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

    if -3.2981924105391174e-118 < t < 5430407.937503214

    1. Initial program 1.8

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

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

    if 5430407.937503214 < t

    1. Initial program 9.4

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
    4. Using strategy rm
    5. Applied div-inv1.2

      \[\leadsto x + \frac{y - x}{\color{blue}{t \cdot \frac{1}{z}}}\]
    6. Applied associate-/r*1.0

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

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

Reproduce

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