Average Error: 24.8 → 10.7
Time: 1.0m
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -9.79529762078173593280535198605757013158 \cdot 10^{279}:\\ \;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\ \mathbf{elif}\;z \le 1.598379849628712025701715812034079117588 \cdot 10^{185}:\\ \;\;\;\;x + \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{t - x}{\sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}\right)\\ \mathbf{else}:\\ \;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -9.79529762078173593280535198605757013158 \cdot 10^{279}:\\
\;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\

\mathbf{elif}\;z \le 1.598379849628712025701715812034079117588 \cdot 10^{185}:\\
\;\;\;\;x + \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{t - x}{\sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r33524512 = x;
        double r33524513 = y;
        double r33524514 = z;
        double r33524515 = r33524513 - r33524514;
        double r33524516 = t;
        double r33524517 = r33524516 - r33524512;
        double r33524518 = r33524515 * r33524517;
        double r33524519 = a;
        double r33524520 = r33524519 - r33524514;
        double r33524521 = r33524518 / r33524520;
        double r33524522 = r33524512 + r33524521;
        return r33524522;
}

double f(double x, double y, double z, double t, double a) {
        double r33524523 = z;
        double r33524524 = -9.795297620781736e+279;
        bool r33524525 = r33524523 <= r33524524;
        double r33524526 = t;
        double r33524527 = x;
        double r33524528 = r33524527 / r33524523;
        double r33524529 = r33524526 / r33524523;
        double r33524530 = r33524528 - r33524529;
        double r33524531 = y;
        double r33524532 = r33524530 * r33524531;
        double r33524533 = r33524526 + r33524532;
        double r33524534 = 1.598379849628712e+185;
        bool r33524535 = r33524523 <= r33524534;
        double r33524536 = r33524531 - r33524523;
        double r33524537 = cbrt(r33524536);
        double r33524538 = r33524537 * r33524537;
        double r33524539 = a;
        double r33524540 = r33524539 - r33524523;
        double r33524541 = cbrt(r33524540);
        double r33524542 = r33524538 / r33524541;
        double r33524543 = r33524526 - r33524527;
        double r33524544 = r33524543 / r33524541;
        double r33524545 = r33524537 / r33524541;
        double r33524546 = r33524544 * r33524545;
        double r33524547 = r33524542 * r33524546;
        double r33524548 = r33524527 + r33524547;
        double r33524549 = r33524535 ? r33524548 : r33524533;
        double r33524550 = r33524525 ? r33524533 : r33524549;
        return r33524550;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original24.8
Target12.0
Herbie10.7
\[\begin{array}{l} \mathbf{if}\;z \lt -1.253613105609503593846459977496550767343 \cdot 10^{188}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{elif}\;z \lt 4.446702369113811028051510715777703865332 \cdot 10^{64}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -9.795297620781736e+279 or 1.598379849628712e+185 < z

    1. Initial program 51.1

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt25.6

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

      \[\leadsto x + \color{blue}{\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}\right)} \cdot \frac{t - x}{\sqrt[3]{a - z}}\]
    8. Applied associate-*l*25.6

      \[\leadsto x + \color{blue}{\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\right)}\]
    9. Taylor expanded around inf 23.6

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

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

    if -9.795297620781736e+279 < z < 1.598379849628712e+185

    1. Initial program 20.4

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

      \[\leadsto x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}}\]
    4. Applied times-frac10.6

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt10.6

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

      \[\leadsto x + \color{blue}{\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}\right)} \cdot \frac{t - x}{\sqrt[3]{a - z}}\]
    8. Applied associate-*l*10.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -9.79529762078173593280535198605757013158 \cdot 10^{279}:\\ \;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\ \mathbf{elif}\;z \le 1.598379849628712025701715812034079117588 \cdot 10^{185}:\\ \;\;\;\;x + \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{t - x}{\sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}\right)\\ \mathbf{else}:\\ \;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019200 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"

  :herbie-target
  (if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

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