Average Error: 14.6 → 13.4
Time: 14.8s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -3.2582793557416086 \cdot 10^{232}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \le 6.50101691097810777 \cdot 10^{225}:\\ \;\;\;\;\mathsf{fma}\left(\left(t - x\right) \cdot \frac{1}{a - z}, y - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;z \le -3.2582793557416086 \cdot 10^{232}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \le 6.50101691097810777 \cdot 10^{225}:\\
\;\;\;\;\mathsf{fma}\left(\left(t - x\right) \cdot \frac{1}{a - z}, y - z, x\right)\\

\mathbf{else}:\\
\;\;\;\;t\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r131769 = x;
        double r131770 = y;
        double r131771 = z;
        double r131772 = r131770 - r131771;
        double r131773 = t;
        double r131774 = r131773 - r131769;
        double r131775 = a;
        double r131776 = r131775 - r131771;
        double r131777 = r131774 / r131776;
        double r131778 = r131772 * r131777;
        double r131779 = r131769 + r131778;
        return r131779;
}

double f(double x, double y, double z, double t, double a) {
        double r131780 = z;
        double r131781 = -3.2582793557416086e+232;
        bool r131782 = r131780 <= r131781;
        double r131783 = t;
        double r131784 = 6.501016910978108e+225;
        bool r131785 = r131780 <= r131784;
        double r131786 = x;
        double r131787 = r131783 - r131786;
        double r131788 = 1.0;
        double r131789 = a;
        double r131790 = r131789 - r131780;
        double r131791 = r131788 / r131790;
        double r131792 = r131787 * r131791;
        double r131793 = y;
        double r131794 = r131793 - r131780;
        double r131795 = fma(r131792, r131794, r131786);
        double r131796 = r131785 ? r131795 : r131783;
        double r131797 = r131782 ? r131783 : r131796;
        return r131797;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Derivation

  1. Split input into 2 regimes
  2. if z < -3.2582793557416086e+232 or 6.501016910978108e+225 < z

    1. Initial program 30.7

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)}\]
    3. Taylor expanded around 0 22.4

      \[\leadsto \color{blue}{t}\]

    if -3.2582793557416086e+232 < z < 6.501016910978108e+225

    1. Initial program 11.8

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)}\]
    3. Using strategy rm
    4. Applied div-inv11.8

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(t - x\right) \cdot \frac{1}{a - z}}, y - z, x\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification13.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -3.2582793557416086 \cdot 10^{232}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \le 6.50101691097810777 \cdot 10^{225}:\\ \;\;\;\;\mathsf{fma}\left(\left(t - x\right) \cdot \frac{1}{a - z}, y - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array}\]

Reproduce

herbie shell --seed 2020047 +o rules:numerics
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
  :precision binary64
  (+ x (* (- y z) (/ (- t x) (- a z)))))