Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3

Percentage Accurate: 68.3% → 88.6%
Time: 35.9s
Alternatives: 9
Speedup: 0.8×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a):
	return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - x) * (z - t)) / (a - t));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 9 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 68.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a):
	return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - x) * (z - t)) / (a - t));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}

Alternative 1: 88.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\ \mathbf{if}\;t \leq -2.5 \cdot 10^{+80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+248}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (fma (- x y) (/ (- z a) t) y)))
   (if (<= t -2.5e+80)
     t_1
     (if (<= t 1.9e+248) (fma (/ (- z t) (- a t)) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fma((x - y), ((z - a) / t), y);
	double tmp;
	if (t <= -2.5e+80) {
		tmp = t_1;
	} else if (t <= 1.9e+248) {
		tmp = fma(((z - t) / (a - t)), (y - x), x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = fma(Float64(x - y), Float64(Float64(z - a) / t), y)
	tmp = 0.0
	if (t <= -2.5e+80)
		tmp = t_1;
	elseif (t <= 1.9e+248)
		tmp = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -2.5e+80], t$95$1, If[LessEqual[t, 1.9e+248], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.9 \cdot 10^{+248}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.4999999999999998e80 or 1.9e248 < t

    1. Initial program 20.1%

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

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. distribute-lft-out--N/A

        \[\leadsto y + \color{blue}{-1 \cdot \left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      3. div-subN/A

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

        \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t} + y} \]
      5. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\right)\right)} + y \]
      6. distribute-rgt-out--N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\left(y - x\right) \cdot \left(z - a\right)}}{t}\right)\right) + y \]
      7. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot \frac{z - a}{t}}\right)\right) + y \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot \frac{z - a}{t}} + y \]
      9. mul-1-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot \left(y - x\right)\right)} \cdot \frac{z - a}{t} + y \]
      10. lower-fma.f64N/A

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

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

    if -2.4999999999999998e80 < t < 1.9e248

    1. Initial program 79.4%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right)} \cdot \left(z - t\right)}{a - t} \]
      2. lift--.f64N/A

        \[\leadsto x + \frac{\left(y - x\right) \cdot \color{blue}{\left(z - t\right)}}{a - t} \]
      3. lift-*.f64N/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right) \cdot \left(z - t\right)}}{a - t} \]
      4. remove-double-negN/A

        \[\leadsto x + \frac{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(y - x\right) \cdot \left(z - t\right)\right)\right)\right)}}{a - t} \]
      5. lift--.f64N/A

        \[\leadsto x + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(y - x\right) \cdot \left(z - t\right)\right)\right)\right)}{\color{blue}{a - t}} \]
      6. remove-double-negN/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right) \cdot \left(z - t\right)}}{a - t} \]
      7. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} + x} \]
      9. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}} + x \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(y - x\right) \cdot \left(z - t\right)}}{a - t} + x \]
      11. associate-/l*N/A

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z - t}{a - t}} + x \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{z - t}{a - t} \cdot \left(y - x\right)} + x \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)} \]
      14. lower-/.f6490.6

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z - t}{a - t}}, y - x, x\right) \]
    4. Applied rewrites90.6%

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

Alternative 2: 76.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\ \mathbf{if}\;a \leq -3.7 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 28:\\ \;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (fma (- y x) (/ (- z t) a) x)))
   (if (<= a -3.7e+22)
     t_1
     (if (<= a 28.0) (fma (- x y) (/ (- z a) t) y) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fma((y - x), ((z - t) / a), x);
	double tmp;
	if (a <= -3.7e+22) {
		tmp = t_1;
	} else if (a <= 28.0) {
		tmp = fma((x - y), ((z - a) / t), y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = fma(Float64(y - x), Float64(Float64(z - t) / a), x)
	tmp = 0.0
	if (a <= -3.7e+22)
		tmp = t_1;
	elseif (a <= 28.0)
		tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.7e+22], t$95$1, If[LessEqual[a, 28.0], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{if}\;a \leq -3.7 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.6999999999999998e22 or 28 < a

    1. Initial program 70.5%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right)} \cdot \left(z - t\right)}{a - t} \]
      2. lift--.f64N/A

        \[\leadsto x + \frac{\left(y - x\right) \cdot \color{blue}{\left(z - t\right)}}{a - t} \]
      3. *-commutativeN/A

        \[\leadsto x + \frac{\color{blue}{\left(z - t\right) \cdot \left(y - x\right)}}{a - t} \]
      4. lift--.f64N/A

        \[\leadsto x + \frac{\left(z - t\right) \cdot \color{blue}{\left(y - x\right)}}{a - t} \]
      5. flip--N/A

        \[\leadsto x + \frac{\left(z - t\right) \cdot \color{blue}{\frac{y \cdot y - x \cdot x}{y + x}}}{a - t} \]
      6. clear-numN/A

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

        \[\leadsto x + \frac{\color{blue}{\frac{z - t}{\frac{y + x}{y \cdot y - x \cdot x}}}}{a - t} \]
      8. lower-/.f64N/A

        \[\leadsto x + \frac{\color{blue}{\frac{z - t}{\frac{y + x}{y \cdot y - x \cdot x}}}}{a - t} \]
      9. clear-numN/A

        \[\leadsto x + \frac{\frac{z - t}{\color{blue}{\frac{1}{\frac{y \cdot y - x \cdot x}{y + x}}}}}{a - t} \]
      10. flip--N/A

        \[\leadsto x + \frac{\frac{z - t}{\frac{1}{\color{blue}{y - x}}}}{a - t} \]
      11. lift--.f64N/A

        \[\leadsto x + \frac{\frac{z - t}{\frac{1}{\color{blue}{y - x}}}}{a - t} \]
      12. lower-/.f6470.4

        \[\leadsto x + \frac{\frac{z - t}{\color{blue}{\frac{1}{y - x}}}}{a - t} \]
    4. Applied rewrites70.4%

      \[\leadsto x + \frac{\color{blue}{\frac{z - t}{\frac{1}{y - x}}}}{a - t} \]
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot \left(z - t\right)}{a} + x} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z - t}{a}} + x \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)} \]
      4. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{y - x}, \frac{z - t}{a}, x\right) \]
      5. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{\frac{z - t}{a}}, x\right) \]
      6. lower--.f6480.8

        \[\leadsto \mathsf{fma}\left(y - x, \frac{\color{blue}{z - t}}{a}, x\right) \]
    7. Applied rewrites80.8%

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

    if -3.6999999999999998e22 < a < 28

    1. Initial program 62.8%

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

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. distribute-lft-out--N/A

        \[\leadsto y + \color{blue}{-1 \cdot \left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      3. div-subN/A

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

        \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t} + y} \]
      5. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\right)\right)} + y \]
      6. distribute-rgt-out--N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\left(y - x\right) \cdot \left(z - a\right)}}{t}\right)\right) + y \]
      7. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot \frac{z - a}{t}}\right)\right) + y \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot \frac{z - a}{t}} + y \]
      9. mul-1-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot \left(y - x\right)\right)} \cdot \frac{z - a}{t} + y \]
      10. lower-fma.f64N/A

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

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

Alternative 3: 72.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\ \mathbf{if}\;a \leq -3.7 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 47:\\ \;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (fma z (/ (- y x) a) x)))
   (if (<= a -3.7e+22)
     t_1
     (if (<= a 47.0) (fma (- x y) (/ (- z a) t) y) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fma(z, ((y - x) / a), x);
	double tmp;
	if (a <= -3.7e+22) {
		tmp = t_1;
	} else if (a <= 47.0) {
		tmp = fma((x - y), ((z - a) / t), y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = fma(z, Float64(Float64(y - x) / a), x)
	tmp = 0.0
	if (a <= -3.7e+22)
		tmp = t_1;
	elseif (a <= 47.0)
		tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3.7e+22], t$95$1, If[LessEqual[a, 47.0], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{if}\;a \leq -3.7 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.6999999999999998e22 or 47 < a

    1. Initial program 70.5%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x + \frac{z \cdot \left(y - x\right)}{a}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{a} + x} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{z \cdot \frac{y - x}{a}} + x \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{y - x}{a}}, x\right) \]
      5. lower--.f6472.9

        \[\leadsto \mathsf{fma}\left(z, \frac{\color{blue}{y - x}}{a}, x\right) \]
    5. Applied rewrites72.9%

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

    if -3.6999999999999998e22 < a < 47

    1. Initial program 62.8%

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

      \[\leadsto \color{blue}{\left(y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}\right) - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{y + \left(-1 \cdot \frac{z \cdot \left(y - x\right)}{t} - -1 \cdot \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      2. distribute-lft-out--N/A

        \[\leadsto y + \color{blue}{-1 \cdot \left(\frac{z \cdot \left(y - x\right)}{t} - \frac{a \cdot \left(y - x\right)}{t}\right)} \]
      3. div-subN/A

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

        \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t} + y} \]
      5. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{z \cdot \left(y - x\right) - a \cdot \left(y - x\right)}{t}\right)\right)} + y \]
      6. distribute-rgt-out--N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\left(y - x\right) \cdot \left(z - a\right)}}{t}\right)\right) + y \]
      7. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y - x\right) \cdot \frac{z - a}{t}}\right)\right) + y \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(y - x\right)\right)\right) \cdot \frac{z - a}{t}} + y \]
      9. mul-1-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot \left(y - x\right)\right)} \cdot \frac{z - a}{t} + y \]
      10. lower-fma.f64N/A

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

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

Alternative 4: 67.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\ \mathbf{if}\;a \leq -9.5 \cdot 10^{-58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-86}:\\ \;\;\;\;y + \frac{z \cdot \left(x - y\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (fma z (/ (- y x) a) x)))
   (if (<= a -9.5e-58) t_1 (if (<= a 1.4e-86) (+ y (/ (* z (- x y)) t)) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fma(z, ((y - x) / a), x);
	double tmp;
	if (a <= -9.5e-58) {
		tmp = t_1;
	} else if (a <= 1.4e-86) {
		tmp = y + ((z * (x - y)) / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = fma(z, Float64(Float64(y - x) / a), x)
	tmp = 0.0
	if (a <= -9.5e-58)
		tmp = t_1;
	elseif (a <= 1.4e-86)
		tmp = Float64(y + Float64(Float64(z * Float64(x - y)) / t));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -9.5e-58], t$95$1, If[LessEqual[a, 1.4e-86], N[(y + N[(N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.4 \cdot 10^{-86}:\\
\;\;\;\;y + \frac{z \cdot \left(x - y\right)}{t}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.4999999999999994e-58 or 1.40000000000000005e-86 < a

    1. Initial program 68.4%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x + \frac{z \cdot \left(y - x\right)}{a}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{a} + x} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{z \cdot \frac{y - x}{a}} + x \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{y - x}{a}}, x\right) \]
      5. lower--.f6468.5

        \[\leadsto \mathsf{fma}\left(z, \frac{\color{blue}{y - x}}{a}, x\right) \]
    5. Applied rewrites68.5%

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

    if -9.4999999999999994e-58 < a < 1.40000000000000005e-86

    1. Initial program 63.8%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right)} \cdot \left(z - t\right)}{a - t} \]
      2. sub-negN/A

        \[\leadsto x + \frac{\left(y - x\right) \cdot \color{blue}{\left(z + \left(\mathsf{neg}\left(t\right)\right)\right)}}{a - t} \]
      3. +-commutativeN/A

        \[\leadsto x + \frac{\left(y - x\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(t\right)\right) + z\right)}}{a - t} \]
      4. distribute-lft-inN/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right) \cdot \left(\mathsf{neg}\left(t\right)\right) + \left(y - x\right) \cdot z}}{a - t} \]
      5. lift--.f64N/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right)} \cdot \left(\mathsf{neg}\left(t\right)\right) + \left(y - x\right) \cdot z}{a - t} \]
      6. flip3--N/A

        \[\leadsto x + \frac{\color{blue}{\frac{{y}^{3} - {x}^{3}}{y \cdot y + \left(x \cdot x + y \cdot x\right)}} \cdot \left(\mathsf{neg}\left(t\right)\right) + \left(y - x\right) \cdot z}{a - t} \]
      7. div-invN/A

        \[\leadsto x + \frac{\color{blue}{\left(\left({y}^{3} - {x}^{3}\right) \cdot \frac{1}{y \cdot y + \left(x \cdot x + y \cdot x\right)}\right)} \cdot \left(\mathsf{neg}\left(t\right)\right) + \left(y - x\right) \cdot z}{a - t} \]
      8. associate-*l*N/A

        \[\leadsto x + \frac{\color{blue}{\left({y}^{3} - {x}^{3}\right) \cdot \left(\frac{1}{y \cdot y + \left(x \cdot x + y \cdot x\right)} \cdot \left(\mathsf{neg}\left(t\right)\right)\right)} + \left(y - x\right) \cdot z}{a - t} \]
      9. lower-fma.f64N/A

        \[\leadsto x + \frac{\color{blue}{\mathsf{fma}\left({y}^{3} - {x}^{3}, \frac{1}{y \cdot y + \left(x \cdot x + y \cdot x\right)} \cdot \left(\mathsf{neg}\left(t\right)\right), \left(y - x\right) \cdot z\right)}}{a - t} \]
    4. Applied rewrites23.0%

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

      \[\leadsto \color{blue}{y + -1 \cdot \frac{z \cdot \left(y - x\right)}{t}} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto y + \color{blue}{\left(\mathsf{neg}\left(\frac{z \cdot \left(y - x\right)}{t}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \color{blue}{y - \frac{z \cdot \left(y - x\right)}{t}} \]
      3. lower--.f64N/A

        \[\leadsto \color{blue}{y - \frac{z \cdot \left(y - x\right)}{t}} \]
      4. lower-/.f64N/A

        \[\leadsto y - \color{blue}{\frac{z \cdot \left(y - x\right)}{t}} \]
      5. lower-*.f64N/A

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

        \[\leadsto y - \frac{z \cdot \color{blue}{\left(y - x\right)}}{t} \]
    7. Applied rewrites79.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.5 \cdot 10^{-58}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-86}:\\ \;\;\;\;y + \frac{z \cdot \left(x - y\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 64.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;t \leq -2.3 \cdot 10^{+19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{+134}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- z t) (- a t)))))
   (if (<= t -2.3e+19) t_1 (if (<= t 2.7e+134) (fma z (/ (- y x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((z - t) / (a - t));
	double tmp;
	if (t <= -2.3e+19) {
		tmp = t_1;
	} else if (t <= 2.7e+134) {
		tmp = fma(z, ((y - x) / a), x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t)))
	tmp = 0.0
	if (t <= -2.3e+19)
		tmp = t_1;
	elseif (t <= 2.7e+134)
		tmp = fma(z, Float64(Float64(y - x) / a), x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.3e+19], t$95$1, If[LessEqual[t, 2.7e+134], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.7 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.3e19 or 2.7e134 < t

    1. Initial program 33.0%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{t \cdot \left(y - x\right)}{a - t} + z \cdot \left(\frac{y}{a - t} - \frac{x}{a - t}\right)\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \color{blue}{\left(x + -1 \cdot \frac{t \cdot \left(y - x\right)}{a - t}\right) + z \cdot \left(\frac{y}{a - t} - \frac{x}{a - t}\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{z \cdot \left(\frac{y}{a - t} - \frac{x}{a - t}\right) + \left(x + -1 \cdot \frac{t \cdot \left(y - x\right)}{a - t}\right)} \]
      3. div-subN/A

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{a - t}} + \left(x + -1 \cdot \frac{t \cdot \left(y - x\right)}{a - t}\right) \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{a - t}} + \left(x + -1 \cdot \frac{t \cdot \left(y - x\right)}{a - t}\right) \]
      5. *-commutativeN/A

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{a - t}, x + -1 \cdot \frac{t \cdot \left(y - x\right)}{a - t}\right)} \]
      8. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{y - x}, \frac{z}{a - t}, x + -1 \cdot \frac{t \cdot \left(y - x\right)}{a - t}\right) \]
      9. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{\frac{z}{a - t}}, x + -1 \cdot \frac{t \cdot \left(y - x\right)}{a - t}\right) \]
      10. lower--.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{a - t}, \mathsf{fma}\left(x - y, \frac{t}{a - t}, x\right)\right)} \]
    6. Step-by-step derivation
      1. lift--.f6471.6

        \[\leadsto \mathsf{fma}\left(\color{blue}{y - x}, \frac{z}{a - t}, \mathsf{fma}\left(x - y, \frac{t}{a - t}, x\right)\right) \]
      2. remove-double-divN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{1}{y - x}}}, \frac{z}{a - t}, \mathsf{fma}\left(x - y, \frac{t}{a - t}, x\right)\right) \]
      3. frac-2negN/A

        \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(y - x\right)\right)}}}, \frac{z}{a - t}, \mathsf{fma}\left(x - y, \frac{t}{a - t}, x\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\left(y - x\right)\right)}}, \frac{z}{a - t}, \mathsf{fma}\left(x - y, \frac{t}{a - t}, x\right)\right) \]
      5. associate-/r/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{-1} \cdot \left(\mathsf{neg}\left(\left(y - x\right)\right)\right)}, \frac{z}{a - t}, \mathsf{fma}\left(x - y, \frac{t}{a - t}, x\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{-1} \cdot \left(\mathsf{neg}\left(\left(y - x\right)\right)\right), \frac{z}{a - t}, \mathsf{fma}\left(x - y, \frac{t}{a - t}, x\right)\right) \]
      7. lower-*.f64N/A

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{t}{a - t} + \frac{z}{a - t}\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{z}{a - t} + -1 \cdot \frac{t}{a - t}\right)} \]
      2. mul-1-negN/A

        \[\leadsto y \cdot \left(\frac{z}{a - t} + \color{blue}{\left(\mathsf{neg}\left(\frac{t}{a - t}\right)\right)}\right) \]
      3. sub-negN/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{z}{a - t} - \frac{t}{a - t}\right)} \]
      4. div-subN/A

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a - t}} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]
      6. lower-/.f64N/A

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a - t}} \]
      7. lower--.f64N/A

        \[\leadsto y \cdot \frac{\color{blue}{z - t}}{a - t} \]
      8. lower--.f6469.5

        \[\leadsto y \cdot \frac{z - t}{\color{blue}{a - t}} \]
    10. Applied rewrites69.5%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a - t}} \]

    if -2.3e19 < t < 2.7e134

    1. Initial program 83.6%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x + \frac{z \cdot \left(y - x\right)}{a}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{a} + x} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{z \cdot \frac{y - x}{a}} + x \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{y - x}{a}}, x\right) \]
      5. lower--.f6469.0

        \[\leadsto \mathsf{fma}\left(z, \frac{\color{blue}{y - x}}{a}, x\right) \]
    5. Applied rewrites69.0%

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

Alternative 6: 59.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + \left(x - x\right)\\ \mathbf{if}\;t \leq -1.8 \cdot 10^{+45}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{+134}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ y (- x x))))
   (if (<= t -1.8e+45) t_1 (if (<= t 2.7e+134) (fma z (/ (- y x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y + (x - x);
	double tmp;
	if (t <= -1.8e+45) {
		tmp = t_1;
	} else if (t <= 2.7e+134) {
		tmp = fma(z, ((y - x) / a), x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(y + Float64(x - x))
	tmp = 0.0
	if (t <= -1.8e+45)
		tmp = t_1;
	elseif (t <= 2.7e+134)
		tmp = fma(z, Float64(Float64(y - x) / a), x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y + N[(x - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.8e+45], t$95$1, If[LessEqual[t, 2.7e+134], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y + \left(x - x\right)\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.7 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.8e45 or 2.7e134 < t

    1. Initial program 29.2%

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

      \[\leadsto x + \color{blue}{\left(y - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6431.0

        \[\leadsto x + \color{blue}{\left(y - x\right)} \]
    5. Applied rewrites31.0%

      \[\leadsto x + \color{blue}{\left(y - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(y - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(y - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(y - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{y - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{y - \left(x - x\right)} \]
      6. lower--.f6451.0

        \[\leadsto y - \color{blue}{\left(x - x\right)} \]
    7. Applied rewrites51.0%

      \[\leadsto \color{blue}{y - \left(x - x\right)} \]

    if -1.8e45 < t < 2.7e134

    1. Initial program 83.7%

      \[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x + \frac{z \cdot \left(y - x\right)}{a}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{z \cdot \left(y - x\right)}{a} + x} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{z \cdot \frac{y - x}{a}} + x \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{y - x}{a}}, x\right) \]
      5. lower--.f6467.9

        \[\leadsto \mathsf{fma}\left(z, \frac{\color{blue}{y - x}}{a}, x\right) \]
    5. Applied rewrites67.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+45}:\\ \;\;\;\;y + \left(x - x\right)\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{+134}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;y + \left(x - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 25.9% accurate, 4.1× speedup?

\[\begin{array}{l} \\ y + \left(x - x\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ y (- x x)))
double code(double x, double y, double z, double t, double a) {
	return y + (x - x);
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = y + (x - x)
end function
public static double code(double x, double y, double z, double t, double a) {
	return y + (x - x);
}
def code(x, y, z, t, a):
	return y + (x - x)
function code(x, y, z, t, a)
	return Float64(y + Float64(x - x))
end
function tmp = code(x, y, z, t, a)
	tmp = y + (x - x);
end
code[x_, y_, z_, t_, a_] := N[(y + N[(x - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y + \left(x - x\right)
\end{array}
Derivation
  1. Initial program 66.6%

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

    \[\leadsto x + \color{blue}{\left(y - x\right)} \]
  4. Step-by-step derivation
    1. lower--.f6416.3

      \[\leadsto x + \color{blue}{\left(y - x\right)} \]
  5. Applied rewrites16.3%

    \[\leadsto x + \color{blue}{\left(y - x\right)} \]
  6. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto x + \color{blue}{\left(y - x\right)} \]
    2. +-commutativeN/A

      \[\leadsto \color{blue}{\left(y - x\right) + x} \]
    3. lift--.f64N/A

      \[\leadsto \color{blue}{\left(y - x\right)} + x \]
    4. associate-+l-N/A

      \[\leadsto \color{blue}{y - \left(x - x\right)} \]
    5. lower--.f64N/A

      \[\leadsto \color{blue}{y - \left(x - x\right)} \]
    6. lower--.f6423.9

      \[\leadsto y - \color{blue}{\left(x - x\right)} \]
  7. Applied rewrites23.9%

    \[\leadsto \color{blue}{y - \left(x - x\right)} \]
  8. Final simplification23.9%

    \[\leadsto y + \left(x - x\right) \]
  9. Add Preprocessing

Alternative 8: 19.8% accurate, 4.1× speedup?

\[\begin{array}{l} \\ x + \left(y - x\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (- y x)))
double code(double x, double y, double z, double t, double a) {
	return x + (y - x);
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (y - x)
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y - x);
}
def code(x, y, z, t, a):
	return x + (y - x)
function code(x, y, z, t, a)
	return Float64(x + Float64(y - x))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y - x);
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y - x\right)
\end{array}
Derivation
  1. Initial program 66.6%

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

    \[\leadsto x + \color{blue}{\left(y - x\right)} \]
  4. Step-by-step derivation
    1. lower--.f6416.3

      \[\leadsto x + \color{blue}{\left(y - x\right)} \]
  5. Applied rewrites16.3%

    \[\leadsto x + \color{blue}{\left(y - x\right)} \]
  6. Add Preprocessing

Alternative 9: 2.8% accurate, 29.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
	return 0.0;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
	return 0.0;
}
def code(x, y, z, t, a):
	return 0.0
function code(x, y, z, t, a)
	return 0.0
end
function tmp = code(x, y, z, t, a)
	tmp = 0.0;
end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 66.6%

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

    \[\leadsto x + \color{blue}{\left(y - x\right)} \]
  4. Step-by-step derivation
    1. lower--.f6416.3

      \[\leadsto x + \color{blue}{\left(y - x\right)} \]
  5. Applied rewrites16.3%

    \[\leadsto x + \color{blue}{\left(y - x\right)} \]
  6. Taylor expanded in y around 0

    \[\leadsto x + \color{blue}{-1 \cdot x} \]
  7. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
    2. lower-neg.f642.8

      \[\leadsto x + \color{blue}{\left(-x\right)} \]
  8. Applied rewrites2.8%

    \[\leadsto x + \color{blue}{\left(-x\right)} \]
  9. Step-by-step derivation
    1. unsub-negN/A

      \[\leadsto \color{blue}{x - x} \]
    2. +-inverses2.8

      \[\leadsto \color{blue}{0} \]
  10. Applied rewrites2.8%

    \[\leadsto \color{blue}{0} \]
  11. Add Preprocessing

Developer Target 1: 87.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\ \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
   (if (< a -1.6153062845442575e-142)
     t_1
     (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
	double tmp;
	if (a < -1.6153062845442575e-142) {
		tmp = t_1;
	} else if (a < 3.774403170083174e-182) {
		tmp = y - ((z / t) * (y - x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (((y - x) / 1.0d0) * ((z - t) / (a - t)))
    if (a < (-1.6153062845442575d-142)) then
        tmp = t_1
    else if (a < 3.774403170083174d-182) then
        tmp = y - ((z / t) * (y - x))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
	double tmp;
	if (a < -1.6153062845442575e-142) {
		tmp = t_1;
	} else if (a < 3.774403170083174e-182) {
		tmp = y - ((z / t) * (y - x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)))
	tmp = 0
	if a < -1.6153062845442575e-142:
		tmp = t_1
	elif a < 3.774403170083174e-182:
		tmp = y - ((z / t) * (y - x))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(Float64(y - x) / 1.0) * Float64(Float64(z - t) / Float64(a - t))))
	tmp = 0.0
	if (a < -1.6153062845442575e-142)
		tmp = t_1;
	elseif (a < 3.774403170083174e-182)
		tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
	tmp = 0.0;
	if (a < -1.6153062845442575e-142)
		tmp = t_1;
	elseif (a < 3.774403170083174e-182)
		tmp = y - ((z / t) * (y - x));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[a, -1.6153062845442575e-142], t$95$1, If[Less[a, 3.774403170083174e-182], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024220 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< a -646122513817703/4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 1887201585041587/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))))))

  (+ x (/ (* (- y x) (- z t)) (- a t))))