Average Error: 24.9 → 11.5
Time: 5.6s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.9761177729831929 \cdot 10^{-99}:\\ \;\;\;\;x + \frac{y - x}{\left(a - t\right) \cdot \frac{1}{z - t}}\\ \mathbf{elif}\;a \le 1.19906669769776641 \cdot 10^{-273}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{elif}\;a \le 3.1326586772354107 \cdot 10^{-232}:\\ \;\;\;\;x + \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y - x}{\frac{\sqrt[3]{a - t}}{\sqrt[3]{z - t}}}\\ \mathbf{elif}\;a \le 3.1844700299462174 \cdot 10^{-74}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y - x}{\frac{\sqrt[3]{a - t}}{\sqrt[3]{z - t}}}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -1.9761177729831929 \cdot 10^{-99}:\\
\;\;\;\;x + \frac{y - x}{\left(a - t\right) \cdot \frac{1}{z - t}}\\

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

\mathbf{elif}\;a \le 3.1326586772354107 \cdot 10^{-232}:\\
\;\;\;\;x + \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y - x}{\frac{\sqrt[3]{a - t}}{\sqrt[3]{z - t}}}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r861907 = x;
        double r861908 = y;
        double r861909 = r861908 - r861907;
        double r861910 = z;
        double r861911 = t;
        double r861912 = r861910 - r861911;
        double r861913 = r861909 * r861912;
        double r861914 = a;
        double r861915 = r861914 - r861911;
        double r861916 = r861913 / r861915;
        double r861917 = r861907 + r861916;
        return r861917;
}

double f(double x, double y, double z, double t, double a) {
        double r861918 = a;
        double r861919 = -1.976117772983193e-99;
        bool r861920 = r861918 <= r861919;
        double r861921 = x;
        double r861922 = y;
        double r861923 = r861922 - r861921;
        double r861924 = t;
        double r861925 = r861918 - r861924;
        double r861926 = 1.0;
        double r861927 = z;
        double r861928 = r861927 - r861924;
        double r861929 = r861926 / r861928;
        double r861930 = r861925 * r861929;
        double r861931 = r861923 / r861930;
        double r861932 = r861921 + r861931;
        double r861933 = 1.1990666976977664e-273;
        bool r861934 = r861918 <= r861933;
        double r861935 = r861921 * r861927;
        double r861936 = r861935 / r861924;
        double r861937 = r861922 + r861936;
        double r861938 = r861927 * r861922;
        double r861939 = r861938 / r861924;
        double r861940 = r861937 - r861939;
        double r861941 = 3.1326586772354107e-232;
        bool r861942 = r861918 <= r861941;
        double r861943 = cbrt(r861928);
        double r861944 = r861943 * r861943;
        double r861945 = cbrt(r861925);
        double r861946 = r861945 * r861945;
        double r861947 = r861944 / r861946;
        double r861948 = r861945 / r861943;
        double r861949 = r861923 / r861948;
        double r861950 = r861947 * r861949;
        double r861951 = r861921 + r861950;
        double r861952 = 3.1844700299462174e-74;
        bool r861953 = r861918 <= r861952;
        double r861954 = r861953 ? r861940 : r861951;
        double r861955 = r861942 ? r861951 : r861954;
        double r861956 = r861934 ? r861940 : r861955;
        double r861957 = r861920 ? r861932 : r861956;
        return r861957;
}

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
Target9.8
Herbie11.5
\[\begin{array}{l} \mathbf{if}\;a \lt -1.6153062845442575 \cdot 10^{-142}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \lt 3.7744031700831742 \cdot 10^{-182}:\\ \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if a < -1.976117772983193e-99

    1. Initial program 23.0

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*8.9

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}}\]
    4. Using strategy rm
    5. Applied div-inv9.0

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

    if -1.976117772983193e-99 < a < 1.1990666976977664e-273 or 3.1326586772354107e-232 < a < 3.1844700299462174e-74

    1. Initial program 30.2

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

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

    if 1.1990666976977664e-273 < a < 3.1326586772354107e-232 or 3.1844700299462174e-74 < a

    1. Initial program 22.3

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*8.8

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{1}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}} \cdot \frac{y - x}{\frac{\sqrt[3]{a - t}}{\sqrt[3]{z - t}}}}\]
    10. Simplified8.9

      \[\leadsto x + \color{blue}{\frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}} \cdot \frac{y - x}{\frac{\sqrt[3]{a - t}}{\sqrt[3]{z - t}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -1.9761177729831929 \cdot 10^{-99}:\\ \;\;\;\;x + \frac{y - x}{\left(a - t\right) \cdot \frac{1}{z - t}}\\ \mathbf{elif}\;a \le 1.19906669769776641 \cdot 10^{-273}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{elif}\;a \le 3.1326586772354107 \cdot 10^{-232}:\\ \;\;\;\;x + \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y - x}{\frac{\sqrt[3]{a - t}}{\sqrt[3]{z - t}}}\\ \mathbf{elif}\;a \le 3.1844700299462174 \cdot 10^{-74}:\\ \;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y - x}{\frac{\sqrt[3]{a - t}}{\sqrt[3]{z - t}}}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))

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