Average Error: 14.8 → 6.1
Time: 24.2s
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 -1.034567205203707255381370590550516843978 \cdot 10^{-307} \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 \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\frac{x}{z} - \frac{t}{z}\right) + t\\ \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 -1.034567205203707255381370590550516843978 \cdot 10^{-307} \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 \left(t - x\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r135179 = x;
        double r135180 = y;
        double r135181 = z;
        double r135182 = r135180 - r135181;
        double r135183 = t;
        double r135184 = r135183 - r135179;
        double r135185 = a;
        double r135186 = r135185 - r135181;
        double r135187 = r135184 / r135186;
        double r135188 = r135182 * r135187;
        double r135189 = r135179 + r135188;
        return r135189;
}

double f(double x, double y, double z, double t, double a) {
        double r135190 = x;
        double r135191 = y;
        double r135192 = z;
        double r135193 = r135191 - r135192;
        double r135194 = t;
        double r135195 = r135194 - r135190;
        double r135196 = a;
        double r135197 = r135196 - r135192;
        double r135198 = r135195 / r135197;
        double r135199 = r135193 * r135198;
        double r135200 = r135190 + r135199;
        double r135201 = -1.0345672052037073e-307;
        bool r135202 = r135200 <= r135201;
        double r135203 = 0.0;
        bool r135204 = r135200 <= r135203;
        double r135205 = !r135204;
        bool r135206 = r135202 || r135205;
        double r135207 = r135193 / r135197;
        double r135208 = r135207 * r135195;
        double r135209 = r135190 + r135208;
        double r135210 = r135190 / r135192;
        double r135211 = r135194 / r135192;
        double r135212 = r135210 - r135211;
        double r135213 = r135191 * r135212;
        double r135214 = r135213 + r135194;
        double r135215 = r135206 ? r135209 : r135214;
        return r135215;
}

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

    1. Initial program 7.6

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

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

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

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

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

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

    1. Initial program 61.8

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

      \[\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 *-un-lft-identity61.5

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

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

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

      \[\leadsto x + \color{blue}{\frac{\frac{y - z}{\sqrt[3]{a - z}}}{\sqrt[3]{a - z}}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt61.4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le -1.034567205203707255381370590550516843978 \cdot 10^{-307} \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 \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\frac{x}{z} - \frac{t}{z}\right) + t\\ \end{array}\]

Reproduce

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