Average Error: 23.9 → 9.7
Time: 28.0s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -3.988863562054714527313855384569195840914 \cdot 10^{145}:\\ \;\;\;\;\left(t + \frac{x}{\frac{z}{y}}\right) - \frac{t}{\frac{z}{y}}\\ \mathbf{elif}\;z \le 8.673821199850063273475677364859671199714 \cdot 10^{231}:\\ \;\;\;\;x + \left(\frac{t - x}{\sqrt[3]{\sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}} \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(t + \frac{x}{\frac{z}{y}}\right) - \frac{t}{\frac{z}{y}}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -3.988863562054714527313855384569195840914 \cdot 10^{145}:\\
\;\;\;\;\left(t + \frac{x}{\frac{z}{y}}\right) - \frac{t}{\frac{z}{y}}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r35122854 = x;
        double r35122855 = y;
        double r35122856 = z;
        double r35122857 = r35122855 - r35122856;
        double r35122858 = t;
        double r35122859 = r35122858 - r35122854;
        double r35122860 = r35122857 * r35122859;
        double r35122861 = a;
        double r35122862 = r35122861 - r35122856;
        double r35122863 = r35122860 / r35122862;
        double r35122864 = r35122854 + r35122863;
        return r35122864;
}

double f(double x, double y, double z, double t, double a) {
        double r35122865 = z;
        double r35122866 = -3.9888635620547145e+145;
        bool r35122867 = r35122865 <= r35122866;
        double r35122868 = t;
        double r35122869 = x;
        double r35122870 = y;
        double r35122871 = r35122865 / r35122870;
        double r35122872 = r35122869 / r35122871;
        double r35122873 = r35122868 + r35122872;
        double r35122874 = r35122868 / r35122871;
        double r35122875 = r35122873 - r35122874;
        double r35122876 = 8.673821199850063e+231;
        bool r35122877 = r35122865 <= r35122876;
        double r35122878 = r35122868 - r35122869;
        double r35122879 = a;
        double r35122880 = r35122879 - r35122865;
        double r35122881 = cbrt(r35122880);
        double r35122882 = cbrt(r35122881);
        double r35122883 = r35122881 * r35122881;
        double r35122884 = cbrt(r35122883);
        double r35122885 = r35122882 * r35122884;
        double r35122886 = r35122878 / r35122885;
        double r35122887 = r35122870 - r35122865;
        double r35122888 = cbrt(r35122887);
        double r35122889 = r35122888 / r35122881;
        double r35122890 = r35122886 * r35122889;
        double r35122891 = r35122888 * r35122888;
        double r35122892 = r35122891 / r35122881;
        double r35122893 = r35122890 * r35122892;
        double r35122894 = r35122869 + r35122893;
        double r35122895 = r35122877 ? r35122894 : r35122875;
        double r35122896 = r35122867 ? r35122875 : r35122895;
        return r35122896;
}

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

Original23.9
Target11.6
Herbie9.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 < -3.9888635620547145e+145 or 8.673821199850063e+231 < z

    1. Initial program 48.0

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

      \[\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. Taylor expanded around inf 25.1

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

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

    if -3.9888635620547145e+145 < z < 8.673821199850063e+231

    1. Initial program 17.0

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

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

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

      \[\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. Using strategy rm
    9. Applied add-cube-cbrt8.8

      \[\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]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z}}}\]
    10. Applied times-frac8.8

      \[\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]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z}}}\]
    11. Applied associate-*l*8.4

      \[\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]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \sqrt[3]{\sqrt[3]{a - z}}}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification9.7

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

Reproduce

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