Average Error: 24.6 → 10.4
Time: 23.9s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -3.563519643944611782002455223464185594791 \cdot 10^{134}:\\ \;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\ \mathbf{elif}\;z \le 1.18254505279096147893772197683357993476 \cdot 10^{148}:\\ \;\;\;\;\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) + x\\ \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 -3.563519643944611782002455223464185594791 \cdot 10^{134}:\\
\;\;\;\;t + \left(\frac{x}{z} - \frac{t}{z}\right) \cdot y\\

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

\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 r32345660 = x;
        double r32345661 = y;
        double r32345662 = z;
        double r32345663 = r32345661 - r32345662;
        double r32345664 = t;
        double r32345665 = r32345664 - r32345660;
        double r32345666 = r32345663 * r32345665;
        double r32345667 = a;
        double r32345668 = r32345667 - r32345662;
        double r32345669 = r32345666 / r32345668;
        double r32345670 = r32345660 + r32345669;
        return r32345670;
}

double f(double x, double y, double z, double t, double a) {
        double r32345671 = z;
        double r32345672 = -3.5635196439446118e+134;
        bool r32345673 = r32345671 <= r32345672;
        double r32345674 = t;
        double r32345675 = x;
        double r32345676 = r32345675 / r32345671;
        double r32345677 = r32345674 / r32345671;
        double r32345678 = r32345676 - r32345677;
        double r32345679 = y;
        double r32345680 = r32345678 * r32345679;
        double r32345681 = r32345674 + r32345680;
        double r32345682 = 1.1825450527909615e+148;
        bool r32345683 = r32345671 <= r32345682;
        double r32345684 = r32345679 - r32345671;
        double r32345685 = cbrt(r32345684);
        double r32345686 = r32345685 * r32345685;
        double r32345687 = a;
        double r32345688 = r32345687 - r32345671;
        double r32345689 = cbrt(r32345688);
        double r32345690 = r32345686 / r32345689;
        double r32345691 = r32345674 - r32345675;
        double r32345692 = r32345691 / r32345689;
        double r32345693 = r32345685 / r32345689;
        double r32345694 = r32345692 * r32345693;
        double r32345695 = r32345690 * r32345694;
        double r32345696 = r32345695 + r32345675;
        double r32345697 = r32345683 ? r32345696 : r32345681;
        double r32345698 = r32345673 ? r32345681 : r32345697;
        return r32345698;
}

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.6
Target12.0
Herbie10.4
\[\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 < -3.5635196439446118e+134 or 1.1825450527909615e+148 < z

    1. Initial program 46.3

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

      \[\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-frac22.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-cbrt22.3

      \[\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-frac22.3

      \[\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*22.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)}\]
    9. Taylor expanded around inf 25.0

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

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

    if -3.5635196439446118e+134 < z < 1.1825450527909615e+148

    1. Initial program 14.8

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

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

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

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

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

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

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

Reproduce

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