Average Error: 14.6 → 10.0
Time: 4.2s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -3.4874247514004929 \cdot 10^{-149} \lor \neg \left(a \le 2.66694816957246522 \cdot 10^{-200}\right):\\ \;\;\;\;x + \frac{\frac{y - z}{a - z}}{\frac{1}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot y}{z} + t\right) - \frac{t \cdot y}{z}\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -3.4874247514004929 \cdot 10^{-149} \lor \neg \left(a \le 2.66694816957246522 \cdot 10^{-200}\right):\\
\;\;\;\;x + \frac{\frac{y - z}{a - z}}{\frac{1}{t - x}}\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return (x + ((y - z) * ((t - x) / (a - z))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if (((a <= -3.487424751400493e-149) || !(a <= 2.666948169572465e-200))) {
		VAR = (x + (((y - z) / (a - z)) / (1.0 / (t - x))));
	} else {
		VAR = ((((x * y) / z) + t) - ((t * y) / 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.487424751400493e-149 or 2.666948169572465e-200 < a

    1. Initial program 11.9

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

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

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

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

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

      \[\leadsto x + \frac{\color{blue}{\frac{y - z}{a - z}}}{\frac{1}{t - x}}\]

    if -3.487424751400493e-149 < a < 2.666948169572465e-200

    1. Initial program 26.3

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

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

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

Reproduce

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