Average Error: 15.3 → 11.5
Time: 4.4s
Precision: 64
\[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -6.2270682752499666 \cdot 10^{-75}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \left(t - x\right) \cdot \frac{1}{a - z}, x\right)\\ \mathbf{elif}\;a \le 1.0238132444880358 \cdot 10^{-110}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\ \end{array}\]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le -6.2270682752499666 \cdot 10^{-75}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \left(t - x\right) \cdot \frac{1}{a - z}, x\right)\\

\mathbf{elif}\;a \le 1.0238132444880358 \cdot 10^{-110}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\

\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 <= -6.227068275249967e-75)) {
		VAR = fma((y - z), ((t - x) * (1.0 / (a - z))), x);
	} else {
		double VAR_1;
		if ((a <= 1.0238132444880358e-110)) {
			VAR_1 = fma((x / z), y, (t - ((t * y) / z)));
		} else {
			VAR_1 = fma((t - x), ((y - z) / (a - z)), x);
		}
		VAR = VAR_1;
	}
	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 3 regimes
  2. if a < -6.227068275249967e-75

    1. Initial program 10.3

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Simplified10.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)}\]
    3. Using strategy rm
    4. Applied div-inv10.3

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

    if -6.227068275249967e-75 < a < 1.0238132444880358e-110

    1. Initial program 25.2

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Simplified25.2

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)}\]
    3. Using strategy rm
    4. Applied div-inv25.2

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\left(t - x\right) \cdot \frac{1}{a - z}}, x\right)\]
    5. Taylor expanded around inf 16.4

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)}\]

    if 1.0238132444880358e-110 < a

    1. Initial program 11.1

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z}\]
    2. Simplified11.0

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)}\]
    3. Using strategy rm
    4. Applied div-inv11.0

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\left(t - x\right) \cdot \frac{1}{a - z}}, x\right)\]
    5. Using strategy rm
    6. Applied fma-udef11.1

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

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

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

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

      \[\leadsto \left(t - x\right) \cdot \color{blue}{\frac{y - z}{a - z}} + x\]
    12. Using strategy rm
    13. Applied fma-def9.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -6.2270682752499666 \cdot 10^{-75}:\\ \;\;\;\;\mathsf{fma}\left(y - z, \left(t - x\right) \cdot \frac{1}{a - z}, x\right)\\ \mathbf{elif}\;a \le 1.0238132444880358 \cdot 10^{-110}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, t - \frac{t \cdot y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020075 +o rules:numerics
(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)))))