Average Error: 14.9 → 10.0
Time: 5.4s
Precision: binary64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \leq -3.980018115154435 \cdot 10^{-169} \lor \neg \left(a \leq 3.528776701234468 \cdot 10^{-87}\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \leq -3.980018115154435 \cdot 10^{-169} \lor \neg \left(a \leq 3.528776701234468 \cdot 10^{-87}\right):\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot \left(t - x\right)\\

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

\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 (<= a -3.980018115154435e-169) (not (<= a 3.528776701234468e-87)))
   (+ x (* (/ (- y z) (- a z)) (- t x)))
   (+ t (* y (- (/ x z) (/ 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 VAR;
	if (((a <= -3.980018115154435e-169) || !(a <= 3.528776701234468e-87))) {
		VAR = ((double) (x + ((double) ((((double) (y - z)) / ((double) (a - z))) * ((double) (t - x))))));
	} else {
		VAR = ((double) (t + ((double) (y * ((double) ((x / z) - (t / z)))))));
	}
	return VAR;
}

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 < -3.9800181151544353e-169 or 3.528776701234468e-87 < a

    1. Initial program 11.3

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

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

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

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

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

    if -3.9800181151544353e-169 < a < 3.528776701234468e-87

    1. Initial program 24.9

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

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

      \[\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 \leq -3.980018115154435 \cdot 10^{-169} \lor \neg \left(a \leq 3.528776701234468 \cdot 10^{-87}\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\ \end{array}\]

Reproduce

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