Average Error: 14.7 → 7.4
Time: 7.5s
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} \le -9.30598028412173837 \cdot 10^{-248} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 0.0\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot \frac{\sqrt{1}}{\frac{1}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \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} \le -9.30598028412173837 \cdot 10^{-248} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 0.0\right):\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot \frac{\sqrt{1}}{\frac{1}{t - x}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r155904 = x;
        double r155905 = y;
        double r155906 = z;
        double r155907 = r155905 - r155906;
        double r155908 = t;
        double r155909 = r155908 - r155904;
        double r155910 = a;
        double r155911 = r155910 - r155906;
        double r155912 = r155909 / r155911;
        double r155913 = r155907 * r155912;
        double r155914 = r155904 + r155913;
        return r155914;
}

double f(double x, double y, double z, double t, double a) {
        double r155915 = x;
        double r155916 = y;
        double r155917 = z;
        double r155918 = r155916 - r155917;
        double r155919 = t;
        double r155920 = r155919 - r155915;
        double r155921 = a;
        double r155922 = r155921 - r155917;
        double r155923 = r155920 / r155922;
        double r155924 = r155918 * r155923;
        double r155925 = r155915 + r155924;
        double r155926 = -9.305980284121738e-248;
        bool r155927 = r155925 <= r155926;
        double r155928 = 0.0;
        bool r155929 = r155925 <= r155928;
        double r155930 = !r155929;
        bool r155931 = r155927 || r155930;
        double r155932 = r155918 / r155922;
        double r155933 = 1.0;
        double r155934 = sqrt(r155933);
        double r155935 = r155933 / r155920;
        double r155936 = r155934 / r155935;
        double r155937 = r155932 * r155936;
        double r155938 = r155915 + r155937;
        double r155939 = r155915 * r155916;
        double r155940 = r155939 / r155917;
        double r155941 = r155940 + r155919;
        double r155942 = r155919 * r155916;
        double r155943 = r155942 / r155917;
        double r155944 = r155941 - r155943;
        double r155945 = r155931 ? r155938 : r155944;
        return r155945;
}

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)))) < -9.305980284121738e-248 or 0.0 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 7.1

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

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

      \[\leadsto x + \left(y - z\right) \cdot \frac{1}{\color{blue}{\left(a - z\right) \cdot \frac{1}{t - x}}}\]
    6. Applied add-sqr-sqrt7.4

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{a - z}} \cdot \frac{\sqrt{1}}{\frac{1}{t - x}}\]

    if -9.305980284121738e-248 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 0.0

    1. Initial program 58.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -9.30598028412173837 \cdot 10^{-248} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 0.0\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot \frac{\sqrt{1}}{\frac{1}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2020046 
(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)))))