Average Error: 15.0 → 7.3
Time: 6.0s
Precision: binary64
\[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} \leq -9.801367079089213 \cdot 10^{-275} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0\right):\\ \;\;\;\;x + \left(t \cdot \frac{y - z}{a - z} - x \cdot \frac{y - z}{a - z}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{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} \leq -9.801367079089213 \cdot 10^{-275} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0\right):\\
\;\;\;\;x + \left(t \cdot \frac{y - z}{a - z} - x \cdot \frac{y - z}{a - z}\right)\\

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

\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= (+ x (* (- y z) (/ (- t x) (- a z)))) -9.801367079089213e-275)
         (not (<= (+ x (* (- y z) (/ (- t x) (- a z)))) 0.0)))
   (+ x (- (* t (/ (- y z) (- a z))) (* x (/ (- y z) (- a z)))))
   (- (+ t (/ (* x y) z)) (/ (* y t) z))))
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (y - z)) * (((double) (t - x)) / ((double) (a - z)))))));
}
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((((double) (x + ((double) (((double) (y - z)) * (((double) (t - x)) / ((double) (a - z))))))) <= -9.801367079089213e-275) || !(((double) (x + ((double) (((double) (y - z)) * (((double) (t - x)) / ((double) (a - z))))))) <= 0.0))) {
		tmp = ((double) (x + ((double) (((double) (t * (((double) (y - z)) / ((double) (a - z))))) - ((double) (x * (((double) (y - z)) / ((double) (a - z)))))))));
	} else {
		tmp = ((double) (((double) (t + (((double) (x * y)) / z))) - (((double) (y * t)) / z)));
	}
	return tmp;
}

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

    1. Initial program 7.7

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}}\]
    4. Using strategy rm
    5. Applied associate-/r/_binary647.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*_binary644.1

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

      \[\leadsto x + \color{blue}{\frac{y - z}{a - z}} \cdot \left(t - x\right)\]
    8. Using strategy rm
    9. Applied sub-neg_binary644.1

      \[\leadsto x + \frac{y - z}{a - z} \cdot \color{blue}{\left(t + \left(-x\right)\right)}\]
    10. Applied distribute-lft-in_binary644.1

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

    if -9.8013670790892127e-275 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0

    1. Initial program 60.2

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

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

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

      \[\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*_binary6458.4

      \[\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. Taylor expanded around inf 27.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -9.801367079089213 \cdot 10^{-275} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0\right):\\ \;\;\;\;x + \left(t \cdot \frac{y - z}{a - z} - x \cdot \frac{y - z}{a - z}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\ \end{array}\]

Reproduce

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