Average Error: 14.7 → 6.9
Time: 23.7s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -5.235804190643721862771415904141571171352 \cdot 10^{-302}:\\ \;\;\;\;\frac{1}{\frac{a - z}{y - z}} \cdot \left(t - x\right) + x\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 0.0:\\ \;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 4.657027509742154979449084876181542577594 \cdot 10^{-104}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 3.320782556433374160684201492123464231782 \cdot 10^{265}:\\ \;\;\;\;x + \frac{t - x}{a - z} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(y - z\right) \cdot \frac{1}{a - z}\right) \cdot \left(t - x\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -5.235804190643721862771415904141571171352 \cdot 10^{-302}:\\
\;\;\;\;\frac{1}{\frac{a - z}{y - z}} \cdot \left(t - x\right) + x\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r6961046 = x;
        double r6961047 = y;
        double r6961048 = z;
        double r6961049 = r6961047 - r6961048;
        double r6961050 = t;
        double r6961051 = r6961050 - r6961046;
        double r6961052 = a;
        double r6961053 = r6961052 - r6961048;
        double r6961054 = r6961051 / r6961053;
        double r6961055 = r6961049 * r6961054;
        double r6961056 = r6961046 + r6961055;
        return r6961056;
}

double f(double x, double y, double z, double t, double a) {
        double r6961057 = x;
        double r6961058 = t;
        double r6961059 = r6961058 - r6961057;
        double r6961060 = a;
        double r6961061 = z;
        double r6961062 = r6961060 - r6961061;
        double r6961063 = r6961059 / r6961062;
        double r6961064 = y;
        double r6961065 = r6961064 - r6961061;
        double r6961066 = r6961063 * r6961065;
        double r6961067 = r6961057 + r6961066;
        double r6961068 = -5.235804190643722e-302;
        bool r6961069 = r6961067 <= r6961068;
        double r6961070 = 1.0;
        double r6961071 = r6961062 / r6961065;
        double r6961072 = r6961070 / r6961071;
        double r6961073 = r6961072 * r6961059;
        double r6961074 = r6961073 + r6961057;
        double r6961075 = 0.0;
        bool r6961076 = r6961067 <= r6961075;
        double r6961077 = r6961057 * r6961064;
        double r6961078 = r6961077 / r6961061;
        double r6961079 = r6961058 + r6961078;
        double r6961080 = r6961064 * r6961058;
        double r6961081 = r6961080 / r6961061;
        double r6961082 = r6961079 - r6961081;
        double r6961083 = 4.657027509742155e-104;
        bool r6961084 = r6961067 <= r6961083;
        double r6961085 = r6961065 * r6961059;
        double r6961086 = r6961085 / r6961062;
        double r6961087 = r6961086 + r6961057;
        double r6961088 = 3.320782556433374e+265;
        bool r6961089 = r6961067 <= r6961088;
        double r6961090 = r6961070 / r6961062;
        double r6961091 = r6961065 * r6961090;
        double r6961092 = r6961091 * r6961059;
        double r6961093 = r6961057 + r6961092;
        double r6961094 = r6961089 ? r6961067 : r6961093;
        double r6961095 = r6961084 ? r6961087 : r6961094;
        double r6961096 = r6961076 ? r6961082 : r6961095;
        double r6961097 = r6961069 ? r6961074 : r6961096;
        return r6961097;
}

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

Derivation

  1. Split input into 5 regimes
  2. if (+ x (* (- y z) (/ (- t x) (- a z)))) < -5.235804190643722e-302

    1. Initial program 7.7

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}}\]
    4. Using strategy rm
    5. Applied associate-/r/7.8

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{a - z}} \cdot \left(t - x\right)\]
    8. Using strategy rm
    9. Applied clear-num4.3

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

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

    1. Initial program 61.4

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

      \[\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)))) < 4.657027509742155e-104

    1. Initial program 22.0

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

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

    if 4.657027509742155e-104 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 3.320782556433374e+265

    1. Initial program 2.9

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

    if 3.320782556433374e+265 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 15.8

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}}\]
    4. Using strategy rm
    5. Applied associate-/r/15.9

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{a - z}} \cdot \left(t - x\right)\]
    8. Using strategy rm
    9. Applied clear-num3.9

      \[\leadsto x + \color{blue}{\frac{1}{\frac{a - z}{y - z}}} \cdot \left(t - x\right)\]
    10. Using strategy rm
    11. Applied div-inv4.0

      \[\leadsto x + \frac{1}{\color{blue}{\left(a - z\right) \cdot \frac{1}{y - z}}} \cdot \left(t - x\right)\]
    12. Applied add-cube-cbrt4.0

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le -5.235804190643721862771415904141571171352 \cdot 10^{-302}:\\ \;\;\;\;\frac{1}{\frac{a - z}{y - z}} \cdot \left(t - x\right) + x\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 0.0:\\ \;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 4.657027509742154979449084876181542577594 \cdot 10^{-104}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 3.320782556433374160684201492123464231782 \cdot 10^{265}:\\ \;\;\;\;x + \frac{t - x}{a - z} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(y - z\right) \cdot \frac{1}{a - z}\right) \cdot \left(t - x\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019170 
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
  (+ x (* (- y z) (/ (- t x) (- a z)))))