Average Error: 14.8 → 7.5
Time: 20.7s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} = -\infty:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -1.034567205203707255381370590550516843978 \cdot 10^{-307}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.518115222418779116520672469794220737116 \cdot 10^{-285}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t\right) - \frac{t \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)}\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} = -\infty:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)}\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r89841 = x;
        double r89842 = y;
        double r89843 = z;
        double r89844 = r89842 - r89843;
        double r89845 = t;
        double r89846 = r89845 - r89841;
        double r89847 = a;
        double r89848 = r89847 - r89843;
        double r89849 = r89846 / r89848;
        double r89850 = r89844 * r89849;
        double r89851 = r89841 + r89850;
        return r89851;
}

double f(double x, double y, double z, double t, double a) {
        double r89852 = x;
        double r89853 = y;
        double r89854 = z;
        double r89855 = r89853 - r89854;
        double r89856 = t;
        double r89857 = r89856 - r89852;
        double r89858 = a;
        double r89859 = r89858 - r89854;
        double r89860 = r89857 / r89859;
        double r89861 = r89855 * r89860;
        double r89862 = r89852 + r89861;
        double r89863 = -inf.0;
        bool r89864 = r89862 <= r89863;
        double r89865 = r89855 * r89857;
        double r89866 = r89865 / r89859;
        double r89867 = r89852 + r89866;
        double r89868 = -1.0345672052037073e-307;
        bool r89869 = r89862 <= r89868;
        double r89870 = 4.518115222418779e-285;
        bool r89871 = r89862 <= r89870;
        double r89872 = r89852 / r89854;
        double r89873 = fma(r89872, r89853, r89856);
        double r89874 = r89856 * r89853;
        double r89875 = r89874 / r89854;
        double r89876 = r89873 - r89875;
        double r89877 = r89855 / r89859;
        double r89878 = fma(r89877, r89857, r89852);
        double r89879 = sqrt(r89878);
        double r89880 = r89879 * r89879;
        double r89881 = r89871 ? r89876 : r89880;
        double r89882 = r89869 ? r89862 : r89881;
        double r89883 = r89864 ? r89867 : r89882;
        return r89883;
}

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 4 regimes
  2. if (+ x (* (- y z) (/ (- t x) (- a z)))) < -inf.0

    1. Initial program 64.0

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

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

    if -inf.0 < (+ x (* (- y z) (/ (- t x) (- a z)))) < -1.0345672052037073e-307

    1. Initial program 5.1

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

    if -1.0345672052037073e-307 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 4.518115222418779e-285

    1. Initial program 60.8

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

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

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

    if 4.518115222418779e-285 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 7.5

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{a - z}{t - x}}}, y - z, x\right)\]
    5. Using strategy rm
    6. Applied add-sqr-sqrt8.2

      \[\leadsto \color{blue}{\sqrt{\mathsf{fma}\left(\frac{1}{\frac{a - z}{t - x}}, y - z, x\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{1}{\frac{a - z}{t - x}}, y - z, x\right)}}\]
    7. Simplified8.6

      \[\leadsto \color{blue}{\sqrt{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)}} \cdot \sqrt{\mathsf{fma}\left(\frac{1}{\frac{a - z}{t - x}}, y - z, x\right)}\]
    8. Simplified5.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} = -\infty:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -1.034567205203707255381370590550516843978 \cdot 10^{-307}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 4.518115222418779116520672469794220737116 \cdot 10^{-285}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t\right) - \frac{t \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2019235 +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)))))