Average Error: 24.0 → 11.1
Time: 29.2s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -2.065198081982860996989152359302888484807 \cdot 10^{170}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \mathbf{elif}\;z \le 8.311607488137995112797735677641661885277 \cdot 10^{178}:\\ \;\;\;\;x + \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)\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -2.065198081982860996989152359302888484807 \cdot 10^{170}:\\
\;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\

\mathbf{elif}\;z \le 8.311607488137995112797735677641661885277 \cdot 10^{178}:\\
\;\;\;\;x + \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)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r541480 = x;
        double r541481 = y;
        double r541482 = z;
        double r541483 = r541481 - r541482;
        double r541484 = t;
        double r541485 = r541484 - r541480;
        double r541486 = r541483 * r541485;
        double r541487 = a;
        double r541488 = r541487 - r541482;
        double r541489 = r541486 / r541488;
        double r541490 = r541480 + r541489;
        return r541490;
}

double f(double x, double y, double z, double t, double a) {
        double r541491 = z;
        double r541492 = -2.065198081982861e+170;
        bool r541493 = r541491 <= r541492;
        double r541494 = x;
        double r541495 = y;
        double r541496 = r541494 * r541495;
        double r541497 = r541496 / r541491;
        double r541498 = t;
        double r541499 = r541497 + r541498;
        double r541500 = r541498 * r541495;
        double r541501 = r541500 / r541491;
        double r541502 = r541499 - r541501;
        double r541503 = 8.311607488137995e+178;
        bool r541504 = r541491 <= r541503;
        double r541505 = r541495 - r541491;
        double r541506 = cbrt(r541505);
        double r541507 = r541506 * r541506;
        double r541508 = a;
        double r541509 = r541508 - r541491;
        double r541510 = cbrt(r541509);
        double r541511 = r541507 / r541510;
        double r541512 = r541506 / r541510;
        double r541513 = r541498 - r541494;
        double r541514 = r541513 / r541510;
        double r541515 = r541512 * r541514;
        double r541516 = r541511 * r541515;
        double r541517 = r541494 + r541516;
        double r541518 = r541494 / r541491;
        double r541519 = r541498 / r541491;
        double r541520 = r541518 - r541519;
        double r541521 = r541495 * r541520;
        double r541522 = r541498 + r541521;
        double r541523 = r541504 ? r541517 : r541522;
        double r541524 = r541493 ? r541502 : r541523;
        return r541524;
}

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.0
Target11.8
Herbie11.1
\[\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 3 regimes
  2. if z < -2.065198081982861e+170

    1. Initial program 46.4

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Taylor expanded around inf 25.3

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

    if -2.065198081982861e+170 < z < 8.311607488137995e+178

    1. Initial program 16.5

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

      \[\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-frac8.7

      \[\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-cbrt8.7

      \[\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-frac8.7

      \[\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*8.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)}\]

    if 8.311607488137995e+178 < z

    1. Initial program 48.5

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt48.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-frac24.9

      \[\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-cbrt24.5

      \[\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-frac24.5

      \[\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*24.5

      \[\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.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.065198081982860996989152359302888484807 \cdot 10^{170}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \mathbf{elif}\;z \le 8.311607488137995112797735677641661885277 \cdot 10^{178}:\\ \;\;\;\;x + \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)\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< z -1.25361310560950359e188) (- t (* (/ y z) (- t x))) (if (< z 4.44670236911381103e64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

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