Average Error: 15.2 → 6.8
Time: 5.7s
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} \le -2.5808758152771169 \cdot 10^{-290} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 0.0\right):\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t + \left(y \cdot \frac{x}{z} - y \cdot \frac{t}{z}\right)\\ \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 -2.5808758152771169 \cdot 10^{-290} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \le 0.0\right):\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y - z}{a - z}\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z))))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if (((((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z)))))))) <= -2.580875815277117e-290) || !(((double) (x + ((double) (((double) (y - z)) * ((double) (((double) (t - x)) / ((double) (a - z)))))))) <= 0.0))) {
		VAR = ((double) (x + ((double) (((double) (t - x)) * ((double) (((double) (y - z)) / ((double) (a - z))))))));
	} else {
		VAR = ((double) (t + ((double) (((double) (y * ((double) (x / z)))) - ((double) (y * ((double) (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 (+ x (* (- y z) (/ (- t x) (- a z)))) < -2.5808758152771169e-290 or 0.0 < (+ x (* (- y z) (/ (- t x) (- a z))))

    1. Initial program 7.8

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

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

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

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

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

    if -2.5808758152771169e-290 < (+ x (* (- y z) (/ (- t x) (- a z)))) < 0.0

    1. Initial program 61.3

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}}\]
    4. Taylor expanded around inf 27.5

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

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

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

Reproduce

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