Average Error: 14.2 → 10.0
Time: 26.2s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -9.775356164441544470158858032480564423106 \cdot 10^{-50}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot \left(t - x\right)\\ \mathbf{elif}\;a \le 2.669813020611439098191251889703705318259 \cdot 10^{-179}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot \left(t - x\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -9.775356164441544470158858032480564423106 \cdot 10^{-50}:\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot \left(t - x\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r5915682 = x;
        double r5915683 = y;
        double r5915684 = z;
        double r5915685 = r5915683 - r5915684;
        double r5915686 = t;
        double r5915687 = r5915686 - r5915682;
        double r5915688 = a;
        double r5915689 = r5915688 - r5915684;
        double r5915690 = r5915687 / r5915689;
        double r5915691 = r5915685 * r5915690;
        double r5915692 = r5915682 + r5915691;
        return r5915692;
}

double f(double x, double y, double z, double t, double a) {
        double r5915693 = a;
        double r5915694 = -9.775356164441544e-50;
        bool r5915695 = r5915693 <= r5915694;
        double r5915696 = x;
        double r5915697 = y;
        double r5915698 = z;
        double r5915699 = r5915697 - r5915698;
        double r5915700 = r5915693 - r5915698;
        double r5915701 = r5915699 / r5915700;
        double r5915702 = t;
        double r5915703 = r5915702 - r5915696;
        double r5915704 = r5915701 * r5915703;
        double r5915705 = r5915696 + r5915704;
        double r5915706 = 2.669813020611439e-179;
        bool r5915707 = r5915693 <= r5915706;
        double r5915708 = r5915696 / r5915698;
        double r5915709 = r5915702 / r5915698;
        double r5915710 = r5915708 - r5915709;
        double r5915711 = r5915697 * r5915710;
        double r5915712 = r5915702 + r5915711;
        double r5915713 = r5915707 ? r5915712 : r5915705;
        double r5915714 = r5915695 ? r5915705 : r5915713;
        return r5915714;
}

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 a < -9.775356164441544e-50 or 2.669813020611439e-179 < a

    1. Initial program 10.5

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

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

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

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

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

    if -9.775356164441544e-50 < a < 2.669813020611439e-179

    1. Initial program 23.5

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

      \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}}\]
    4. Applied add-cube-cbrt24.4

      \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{\left(\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}\right) \cdot \sqrt[3]{t - x}}}{\left(\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}\right) \cdot \sqrt[3]{a - z}}\]
    5. Applied times-frac24.4

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}} \cdot \frac{\sqrt[3]{a - z}}{\sqrt[3]{t - x}}}} \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\]
    8. Taylor expanded around inf 16.9

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

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

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

Reproduce

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