Average Error: 14.6 → 6.0
Time: 20.3s
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 -1.5335432679341662 \cdot 10^{-301}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y - z}{a - z} + x\\ \mathbf{elif}\;x + \frac{t - x}{a - z} \cdot \left(y - z\right) \le 0.0:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y - z}{a - z} + x\\ \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 -1.5335432679341662 \cdot 10^{-301}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y - z}{a - z} + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r6163016 = x;
        double r6163017 = y;
        double r6163018 = z;
        double r6163019 = r6163017 - r6163018;
        double r6163020 = t;
        double r6163021 = r6163020 - r6163016;
        double r6163022 = a;
        double r6163023 = r6163022 - r6163018;
        double r6163024 = r6163021 / r6163023;
        double r6163025 = r6163019 * r6163024;
        double r6163026 = r6163016 + r6163025;
        return r6163026;
}

double f(double x, double y, double z, double t, double a) {
        double r6163027 = x;
        double r6163028 = t;
        double r6163029 = r6163028 - r6163027;
        double r6163030 = a;
        double r6163031 = z;
        double r6163032 = r6163030 - r6163031;
        double r6163033 = r6163029 / r6163032;
        double r6163034 = y;
        double r6163035 = r6163034 - r6163031;
        double r6163036 = r6163033 * r6163035;
        double r6163037 = r6163027 + r6163036;
        double r6163038 = -1.5335432679341662e-301;
        bool r6163039 = r6163037 <= r6163038;
        double r6163040 = r6163035 / r6163032;
        double r6163041 = r6163029 * r6163040;
        double r6163042 = r6163041 + r6163027;
        double r6163043 = 0.0;
        bool r6163044 = r6163037 <= r6163043;
        double r6163045 = r6163027 / r6163031;
        double r6163046 = r6163028 / r6163031;
        double r6163047 = r6163045 - r6163046;
        double r6163048 = r6163034 * r6163047;
        double r6163049 = r6163028 + r6163048;
        double r6163050 = r6163044 ? r6163049 : r6163042;
        double r6163051 = r6163039 ? r6163042 : r6163050;
        return r6163051;
}

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 2 regimes
  2. if (+ x (* (- y z) (/ (- t x) (- a z)))) < -1.5335432679341662e-301 or 0.0 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 7.3

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

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

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

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

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

    if -1.5335432679341662e-301 < (+ 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. Using strategy rm
    3. Applied clear-num61.3

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{a - z}} \cdot \left(t - x\right)\]
    8. Taylor expanded around inf 26.0

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

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

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

Reproduce

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