Average Error: 24.9 → 8.7
Time: 26.6s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -2.62009319526490299011545259872865617958 \cdot 10^{293}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t - x}{a - z} + x\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -3.956280165893758193874340988906388103674 \cdot 10^{-277}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 0.0:\\ \;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}} \cdot \left(\frac{y - z}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\right)\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z}}}}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -2.62009319526490299011545259872865617958 \cdot 10^{293}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t - x}{a - z} + x\\

\mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -3.956280165893758193874340988906388103674 \cdot 10^{-277}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\

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

\mathbf{else}:\\
\;\;\;\;x + \left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}} \cdot \left(\frac{y - z}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\right)\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z}}}}\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r31081762 = x;
        double r31081763 = y;
        double r31081764 = z;
        double r31081765 = r31081763 - r31081764;
        double r31081766 = t;
        double r31081767 = r31081766 - r31081762;
        double r31081768 = r31081765 * r31081767;
        double r31081769 = a;
        double r31081770 = r31081769 - r31081764;
        double r31081771 = r31081768 / r31081770;
        double r31081772 = r31081762 + r31081771;
        return r31081772;
}

double f(double x, double y, double z, double t, double a) {
        double r31081773 = x;
        double r31081774 = y;
        double r31081775 = z;
        double r31081776 = r31081774 - r31081775;
        double r31081777 = t;
        double r31081778 = r31081777 - r31081773;
        double r31081779 = r31081776 * r31081778;
        double r31081780 = a;
        double r31081781 = r31081780 - r31081775;
        double r31081782 = r31081779 / r31081781;
        double r31081783 = r31081773 + r31081782;
        double r31081784 = -2.620093195264903e+293;
        bool r31081785 = r31081783 <= r31081784;
        double r31081786 = r31081778 / r31081781;
        double r31081787 = r31081776 * r31081786;
        double r31081788 = r31081787 + r31081773;
        double r31081789 = -3.956280165893758e-277;
        bool r31081790 = r31081783 <= r31081789;
        double r31081791 = 0.0;
        bool r31081792 = r31081783 <= r31081791;
        double r31081793 = r31081773 * r31081774;
        double r31081794 = r31081793 / r31081775;
        double r31081795 = r31081777 + r31081794;
        double r31081796 = r31081774 * r31081777;
        double r31081797 = r31081796 / r31081775;
        double r31081798 = r31081795 - r31081797;
        double r31081799 = cbrt(r31081778);
        double r31081800 = cbrt(r31081781);
        double r31081801 = r31081800 * r31081800;
        double r31081802 = cbrt(r31081801);
        double r31081803 = cbrt(r31081802);
        double r31081804 = r31081799 / r31081803;
        double r31081805 = r31081776 / r31081802;
        double r31081806 = r31081799 / r31081801;
        double r31081807 = r31081805 * r31081806;
        double r31081808 = r31081804 * r31081807;
        double r31081809 = cbrt(r31081800);
        double r31081810 = cbrt(r31081809);
        double r31081811 = r31081799 / r31081810;
        double r31081812 = r31081808 * r31081811;
        double r31081813 = r31081773 + r31081812;
        double r31081814 = r31081792 ? r31081798 : r31081813;
        double r31081815 = r31081790 ? r31081783 : r31081814;
        double r31081816 = r31081785 ? r31081788 : r31081815;
        return r31081816;
}

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.9
Target11.8
Herbie8.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 4 regimes
  2. if (+ x (/ (* (- y z) (- t x)) (- a z))) < -2.620093195264903e+293

    1. Initial program 62.2

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{1} \cdot \frac{t - x}{a - z}}\]
    5. Simplified16.8

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

    if -2.620093195264903e+293 < (+ x (/ (* (- y z) (- t x)) (- a z))) < -3.956280165893758e-277

    1. Initial program 2.3

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

    if -3.956280165893758e-277 < (+ x (/ (* (- y z) (- t x)) (- a z))) < 0.0

    1. Initial program 58.8

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

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

    if 0.0 < (+ x (/ (* (- y z) (- t x)) (- a z)))

    1. Initial program 20.9

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

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

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

      \[\leadsto x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\color{blue}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z}}}}\]
    8. Applied *-un-lft-identity8.6

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right)}} \cdot \frac{t - x}{\sqrt[3]{\sqrt[3]{a - z}}}\]
    12. Using strategy rm
    13. Applied add-cube-cbrt8.3

      \[\leadsto x + \frac{y - z}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right)} \cdot \frac{t - x}{\sqrt[3]{\sqrt[3]{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}}}}\]
    14. Applied cbrt-prod8.3

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

      \[\leadsto x + \frac{y - z}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right)} \cdot \frac{t - x}{\color{blue}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{a - z}}}}}\]
    16. Applied add-cube-cbrt8.5

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

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

      \[\leadsto x + \color{blue}{\left(\frac{y - z}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right)} \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z}}}}}\]
    19. Using strategy rm
    20. Applied *-un-lft-identity8.4

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

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

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

      \[\leadsto x + \color{blue}{\left(\left(\frac{y - z}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right)} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{1}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}}\right)} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z}}}}\]
    24. Simplified8.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -2.62009319526490299011545259872865617958 \cdot 10^{293}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t - x}{a - z} + x\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le -3.956280165893758193874340988906388103674 \cdot 10^{-277}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \le 0.0:\\ \;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}} \cdot \left(\frac{y - z}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\right)\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{\sqrt[3]{\sqrt[3]{a - z}}}}\\ \end{array}\]

Reproduce

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