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

Percentage Accurate: 69.2% → 95.1%
Time: 6.3s
Alternatives: 13
Speedup: 0.9×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * (t - x)) / (a - z));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    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 - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a):
	return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - z) * (t - x)) / (a - z));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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 13 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: 69.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * (t - x)) / (a - z));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    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 - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a):
	return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - z) * (t - x)) / (a - z));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 95.1% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.2000000000000002e85

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(t - x\right) \cdot \left(\mathsf{neg}\left(z\right)\right)}{a - z} + \left(\frac{y \cdot \left(t - x\right)}{a - z} + x\right)} \]
    3. Applied rewrites84.9%

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

    if -4.2000000000000002e85 < t < 3.09999999999999994e55

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1, \frac{t \cdot \left(z - y\right)}{a - z}, x \cdot \left(\frac{a}{a - z} - \frac{y}{a - z}\right)\right) \]
      11. lower--.f6482.8

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

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

    if 3.09999999999999994e55 < t

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}, t - x, x\right) \]
      13. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}, t - x, x\right) \]
      17. sub-negate-revN/A

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

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

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

Alternative 2: 90.9% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999975e60

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      12. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}, y - z, x\right) \]
      16. sub-negate-revN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{t - x}{\mathsf{neg}\left(\color{blue}{\left(z - a\right)}\right)}, y - z, x\right) \]
      6. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999975e60 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-1, t \cdot \left(z - y\right), x \cdot \left(a - y\right)\right)}{a - z} \]
      5. lower--.f6474.6

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

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

    if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z)))

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(t - x\right) \cdot \left(\mathsf{neg}\left(z\right)\right)}{a - z} + \left(\frac{y \cdot \left(t - x\right)}{a - z} + x\right)} \]
    3. Applied rewrites84.9%

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

Alternative 3: 90.9% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999975e60

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      12. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}, y - z, x\right) \]
      16. sub-negate-revN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{t - x}{\mathsf{neg}\left(\color{blue}{\left(z - a\right)}\right)}, y - z, x\right) \]
      6. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999975e60 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-1, t \cdot \left(z - y\right), x \cdot \left(a - y\right)\right)}{a - z} \]
      5. lower--.f6474.6

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

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

    if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z)))

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}, t - x, x\right) \]
      13. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}, t - x, x\right) \]
      17. sub-negate-revN/A

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

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

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

Alternative 4: 86.4% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.9999999999999995e168 or 4.49999999999999988e163 < z

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(t - x\right) \cdot \left(\mathsf{neg}\left(z\right)\right)}{a - z} + \left(\frac{y \cdot \left(t - x\right)}{a - z} + x\right)} \]
    3. Applied rewrites84.9%

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

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

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

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

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

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z} \]
      5. lower--.f6444.7

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z} \]
    6. Applied rewrites44.7%

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

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

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

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

        \[\leadsto -1 \cdot \frac{y \cdot \left(t - x\right)}{z} + t \]
      5. mult-flipN/A

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

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

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

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

        \[\leadsto -1 \cdot \left(\left(t - x\right) \cdot \left(y \cdot \frac{1}{z}\right)\right) + t \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \left(y \cdot \frac{1}{z}\right) + t \]
      12. sub-negate-revN/A

        \[\leadsto \left(x - t\right) \cdot \left(y \cdot \frac{1}{z}\right) + t \]
      13. lift--.f64N/A

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

        \[\leadsto \mathsf{fma}\left(x - t, \color{blue}{y \cdot \frac{1}{z}}, t\right) \]
      15. mult-flip-revN/A

        \[\leadsto \mathsf{fma}\left(x - t, \frac{y}{\color{blue}{z}}, t\right) \]
      16. lower-/.f6449.1

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

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

    if -7.9999999999999995e168 < z < 4.49999999999999988e163

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      12. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}, y - z, x\right) \]
      16. sub-negate-revN/A

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

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

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

Alternative 5: 85.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+183}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y}{z}, t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.05e183

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(t - x\right) \cdot \left(\mathsf{neg}\left(z\right)\right)}{a - z} + \left(\frac{y \cdot \left(t - x\right)}{a - z} + x\right)} \]
    3. Applied rewrites84.9%

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

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

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

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

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

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z} \]
      5. lower--.f6444.7

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z} \]
    6. Applied rewrites44.7%

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

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

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

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

        \[\leadsto -1 \cdot \frac{y \cdot \left(t - x\right)}{z} + t \]
      5. mult-flipN/A

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

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

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

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

        \[\leadsto -1 \cdot \left(\left(t - x\right) \cdot \left(y \cdot \frac{1}{z}\right)\right) + t \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \left(y \cdot \frac{1}{z}\right) + t \]
      12. sub-negate-revN/A

        \[\leadsto \left(x - t\right) \cdot \left(y \cdot \frac{1}{z}\right) + t \]
      13. lift--.f64N/A

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

        \[\leadsto \mathsf{fma}\left(x - t, \color{blue}{y \cdot \frac{1}{z}}, t\right) \]
      15. mult-flip-revN/A

        \[\leadsto \mathsf{fma}\left(x - t, \frac{y}{\color{blue}{z}}, t\right) \]
      16. lower-/.f6449.1

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

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

    if -1.05e183 < z

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}, t - x, x\right) \]
      13. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}, t - x, x\right) \]
      17. sub-negate-revN/A

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

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

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

Alternative 6: 71.3% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2e23 or 2.6999999999999999e30 < z

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(t - x\right) \cdot \left(\mathsf{neg}\left(z\right)\right)}{a - z} + \left(\frac{y \cdot \left(t - x\right)}{a - z} + x\right)} \]
    3. Applied rewrites84.9%

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

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

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

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

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

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z} \]
      5. lower--.f6444.7

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z} \]
    6. Applied rewrites44.7%

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

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

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

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

        \[\leadsto -1 \cdot \frac{y \cdot \left(t - x\right)}{z} + t \]
      5. mult-flipN/A

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

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

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

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

        \[\leadsto -1 \cdot \left(\left(t - x\right) \cdot \left(y \cdot \frac{1}{z}\right)\right) + t \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \left(y \cdot \frac{1}{z}\right) + t \]
      12. sub-negate-revN/A

        \[\leadsto \left(x - t\right) \cdot \left(y \cdot \frac{1}{z}\right) + t \]
      13. lift--.f64N/A

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

        \[\leadsto \mathsf{fma}\left(x - t, \color{blue}{y \cdot \frac{1}{z}}, t\right) \]
      15. mult-flip-revN/A

        \[\leadsto \mathsf{fma}\left(x - t, \frac{y}{\color{blue}{z}}, t\right) \]
      16. lower-/.f6449.1

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

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

    if -1.2e23 < z < 2.6999999999999999e30

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}, t - x, x\right) \]
      13. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}, t - x, x\right) \]
      17. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 70.4% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1e22 or 0.0097999999999999997 < z

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(t - x\right) \cdot \left(\mathsf{neg}\left(z\right)\right)}{a - z} + \left(\frac{y \cdot \left(t - x\right)}{a - z} + x\right)} \]
    3. Applied rewrites84.9%

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

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

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

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

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

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z} \]
      5. lower--.f6444.7

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z} \]
    6. Applied rewrites44.7%

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

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

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

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

        \[\leadsto -1 \cdot \frac{y \cdot \left(t - x\right)}{z} + t \]
      5. mult-flipN/A

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

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

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

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

        \[\leadsto -1 \cdot \left(\left(t - x\right) \cdot \left(y \cdot \frac{1}{z}\right)\right) + t \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \left(y \cdot \frac{1}{z}\right) + t \]
      12. sub-negate-revN/A

        \[\leadsto \left(x - t\right) \cdot \left(y \cdot \frac{1}{z}\right) + t \]
      13. lift--.f64N/A

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

        \[\leadsto \mathsf{fma}\left(x - t, \color{blue}{y \cdot \frac{1}{z}}, t\right) \]
      15. mult-flip-revN/A

        \[\leadsto \mathsf{fma}\left(x - t, \frac{y}{\color{blue}{z}}, t\right) \]
      16. lower-/.f6449.1

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

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

    if -1e22 < z < 0.0097999999999999997

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}, t - x, x\right) \]
      13. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}, t - x, x\right) \]
      17. sub-negate-revN/A

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{a}}, t - x, x\right) \]
    5. Step-by-step derivation
      1. lower-/.f6448.8

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

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

Alternative 8: 54.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-31}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.00000000000000009e-32 or 6.49999999999999967e-31 < z

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(t - x\right) \cdot \left(\mathsf{neg}\left(z\right)\right)}{a - z} + \left(\frac{y \cdot \left(t - x\right)}{a - z} + x\right)} \]
    3. Applied rewrites84.9%

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

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

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

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

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

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z} \]
      5. lower--.f6444.7

        \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z} \]
    6. Applied rewrites44.7%

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

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

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

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

        \[\leadsto -1 \cdot \frac{y \cdot \left(t - x\right)}{z} + t \]
      5. mult-flipN/A

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

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

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

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

        \[\leadsto -1 \cdot \left(\left(t - x\right) \cdot \left(y \cdot \frac{1}{z}\right)\right) + t \]
      10. associate-*r*N/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(t - x\right)\right)\right) \cdot \left(y \cdot \frac{1}{z}\right) + t \]
      12. sub-negate-revN/A

        \[\leadsto \left(x - t\right) \cdot \left(y \cdot \frac{1}{z}\right) + t \]
      13. lift--.f64N/A

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

        \[\leadsto \mathsf{fma}\left(x - t, \color{blue}{y \cdot \frac{1}{z}}, t\right) \]
      15. mult-flip-revN/A

        \[\leadsto \mathsf{fma}\left(x - t, \frac{y}{\color{blue}{z}}, t\right) \]
      16. lower-/.f6449.1

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

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

    if -9.00000000000000009e-32 < z < 6.49999999999999967e-31

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \frac{t - x}{\color{blue}{a}} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto y \cdot \frac{t - x}{a} \]
      2. lower--.f6425.8

        \[\leadsto y \cdot \frac{t - x}{a} \]
    7. Applied rewrites25.8%

      \[\leadsto y \cdot \frac{t - x}{\color{blue}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 40.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{-28}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-20}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.4e-28) (+ x t) (if (<= z 5.1e-20) (* y (/ (- t x) a)) (+ x t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.4e-28) {
		tmp = x + t;
	} else if (z <= 5.1e-20) {
		tmp = y * ((t - x) / a);
	} else {
		tmp = x + t;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    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) :: tmp
    if (z <= (-1.4d-28)) then
        tmp = x + t
    else if (z <= 5.1d-20) then
        tmp = y * ((t - x) / a)
    else
        tmp = x + t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.4e-28) {
		tmp = x + t;
	} else if (z <= 5.1e-20) {
		tmp = y * ((t - x) / a);
	} else {
		tmp = x + t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.4e-28:
		tmp = x + t
	elif z <= 5.1e-20:
		tmp = y * ((t - x) / a)
	else:
		tmp = x + t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.4e-28)
		tmp = Float64(x + t);
	elseif (z <= 5.1e-20)
		tmp = Float64(y * Float64(Float64(t - x) / a));
	else
		tmp = Float64(x + t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.4e-28)
		tmp = x + t;
	elseif (z <= 5.1e-20)
		tmp = y * ((t - x) / a);
	else
		tmp = x + t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e-28], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.1e-20], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-28}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq 5.1 \cdot 10^{-20}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\

\mathbf{else}:\\
\;\;\;\;x + t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3999999999999999e-28 or 5.10000000000000019e-20 < z

    1. Initial program 69.2%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    3. Step-by-step derivation
      1. lower--.f6419.8

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

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

      \[\leadsto x + t \]
    6. Step-by-step derivation
      1. Applied rewrites33.7%

        \[\leadsto x + t \]

      if -1.3999999999999999e-28 < z < 5.10000000000000019e-20

      1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{t - x}{\color{blue}{a}} \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto y \cdot \frac{t - x}{a} \]
        2. lower--.f6425.8

          \[\leadsto y \cdot \frac{t - x}{a} \]
      7. Applied rewrites25.8%

        \[\leadsto y \cdot \frac{t - x}{\color{blue}{a}} \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 10: 35.9% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{-28}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-20}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (if (<= z -1.4e-28) (+ x t) (if (<= z 5.5e-20) (* y (/ t (- a z))) (+ x t))))
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (z <= -1.4e-28) {
    		tmp = x + t;
    	} else if (z <= 5.5e-20) {
    		tmp = y * (t / (a - z));
    	} else {
    		tmp = x + t;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a)
    use fmin_fmax_functions
        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) :: tmp
        if (z <= (-1.4d-28)) then
            tmp = x + t
        else if (z <= 5.5d-20) then
            tmp = y * (t / (a - z))
        else
            tmp = x + t
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (z <= -1.4e-28) {
    		tmp = x + t;
    	} else if (z <= 5.5e-20) {
    		tmp = y * (t / (a - z));
    	} else {
    		tmp = x + t;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	tmp = 0
    	if z <= -1.4e-28:
    		tmp = x + t
    	elif z <= 5.5e-20:
    		tmp = y * (t / (a - z))
    	else:
    		tmp = x + t
    	return tmp
    
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if (z <= -1.4e-28)
    		tmp = Float64(x + t);
    	elseif (z <= 5.5e-20)
    		tmp = Float64(y * Float64(t / Float64(a - z)));
    	else
    		tmp = Float64(x + t);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	tmp = 0.0;
    	if (z <= -1.4e-28)
    		tmp = x + t;
    	elseif (z <= 5.5e-20)
    		tmp = y * (t / (a - z));
    	else
    		tmp = x + t;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e-28], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.5e-20], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -1.4 \cdot 10^{-28}:\\
    \;\;\;\;x + t\\
    
    \mathbf{elif}\;z \leq 5.5 \cdot 10^{-20}:\\
    \;\;\;\;y \cdot \frac{t}{a - z}\\
    
    \mathbf{else}:\\
    \;\;\;\;x + t\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.3999999999999999e-28 or 5.4999999999999996e-20 < z

      1. Initial program 69.2%

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

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      3. Step-by-step derivation
        1. lower--.f6419.8

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

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

        \[\leadsto x + t \]
      6. Step-by-step derivation
        1. Applied rewrites33.7%

          \[\leadsto x + t \]

        if -1.3999999999999999e-28 < z < 5.4999999999999996e-20

        1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto y \cdot \frac{t}{a - \color{blue}{z}} \]
          2. lower--.f6423.1

            \[\leadsto y \cdot \frac{t}{a - z} \]
        7. Applied rewrites23.1%

          \[\leadsto y \cdot \frac{t}{\color{blue}{a - z}} \]
      7. Recombined 2 regimes into one program.
      8. Add Preprocessing

      Alternative 11: 35.3% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-138}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-20}:\\ \;\;\;\;\frac{t \cdot y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (<= z -1e-138) (+ x t) (if (<= z 5.1e-20) (/ (* t y) (- a z)) (+ x t))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -1e-138) {
      		tmp = x + t;
      	} else if (z <= 5.1e-20) {
      		tmp = (t * y) / (a - z);
      	} else {
      		tmp = x + t;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a)
      use fmin_fmax_functions
          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) :: tmp
          if (z <= (-1d-138)) then
              tmp = x + t
          else if (z <= 5.1d-20) then
              tmp = (t * y) / (a - z)
          else
              tmp = x + t
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -1e-138) {
      		tmp = x + t;
      	} else if (z <= 5.1e-20) {
      		tmp = (t * y) / (a - z);
      	} else {
      		tmp = x + t;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	tmp = 0
      	if z <= -1e-138:
      		tmp = x + t
      	elif z <= 5.1e-20:
      		tmp = (t * y) / (a - z)
      	else:
      		tmp = x + t
      	return tmp
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (z <= -1e-138)
      		tmp = Float64(x + t);
      	elseif (z <= 5.1e-20)
      		tmp = Float64(Float64(t * y) / Float64(a - z));
      	else
      		tmp = Float64(x + t);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	tmp = 0.0;
      	if (z <= -1e-138)
      		tmp = x + t;
      	elseif (z <= 5.1e-20)
      		tmp = (t * y) / (a - z);
      	else
      		tmp = x + t;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e-138], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.1e-20], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -1 \cdot 10^{-138}:\\
      \;\;\;\;x + t\\
      
      \mathbf{elif}\;z \leq 5.1 \cdot 10^{-20}:\\
      \;\;\;\;\frac{t \cdot y}{a - z}\\
      
      \mathbf{else}:\\
      \;\;\;\;x + t\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.00000000000000007e-138 or 5.10000000000000019e-20 < z

        1. Initial program 69.2%

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

          \[\leadsto x + \color{blue}{\left(t - x\right)} \]
        3. Step-by-step derivation
          1. lower--.f6419.8

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

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

          \[\leadsto x + t \]
        6. Step-by-step derivation
          1. Applied rewrites33.7%

            \[\leadsto x + t \]

          if -1.00000000000000007e-138 < z < 5.10000000000000019e-20

          1. Initial program 69.2%

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

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

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

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

              \[\leadsto \frac{t \cdot \left(y - z\right)}{a - z} \]
            4. lower--.f6439.8

              \[\leadsto \frac{t \cdot \left(y - z\right)}{a - \color{blue}{z}} \]
          4. Applied rewrites39.8%

            \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
          5. Taylor expanded in y around inf

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

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

              \[\leadsto \frac{t \cdot y}{a - z} \]
            3. lower--.f6421.3

              \[\leadsto \frac{t \cdot y}{a - z} \]
          7. Applied rewrites21.3%

            \[\leadsto \frac{t \cdot y}{\color{blue}{a - z}} \]
        7. Recombined 2 regimes into one program.
        8. Add Preprocessing

        Alternative 12: 35.0% accurate, 1.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{-178}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (if (<= z -8.5e-178) (+ x t) (if (<= z 5.5e-167) (/ (* t y) a) (+ x t))))
        double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if (z <= -8.5e-178) {
        		tmp = x + t;
        	} else if (z <= 5.5e-167) {
        		tmp = (t * y) / a;
        	} else {
        		tmp = x + t;
        	}
        	return tmp;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t, a)
        use fmin_fmax_functions
            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) :: tmp
            if (z <= (-8.5d-178)) then
                tmp = x + t
            else if (z <= 5.5d-167) then
                tmp = (t * y) / a
            else
                tmp = x + t
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if (z <= -8.5e-178) {
        		tmp = x + t;
        	} else if (z <= 5.5e-167) {
        		tmp = (t * y) / a;
        	} else {
        		tmp = x + t;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a):
        	tmp = 0
        	if z <= -8.5e-178:
        		tmp = x + t
        	elif z <= 5.5e-167:
        		tmp = (t * y) / a
        	else:
        		tmp = x + t
        	return tmp
        
        function code(x, y, z, t, a)
        	tmp = 0.0
        	if (z <= -8.5e-178)
        		tmp = Float64(x + t);
        	elseif (z <= 5.5e-167)
        		tmp = Float64(Float64(t * y) / a);
        	else
        		tmp = Float64(x + t);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a)
        	tmp = 0.0;
        	if (z <= -8.5e-178)
        		tmp = x + t;
        	elseif (z <= 5.5e-167)
        		tmp = (t * y) / a;
        	else
        		tmp = x + t;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e-178], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.5e-167], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], N[(x + t), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -8.5 \cdot 10^{-178}:\\
        \;\;\;\;x + t\\
        
        \mathbf{elif}\;z \leq 5.5 \cdot 10^{-167}:\\
        \;\;\;\;\frac{t \cdot y}{a}\\
        
        \mathbf{else}:\\
        \;\;\;\;x + t\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -8.5000000000000001e-178 or 5.5000000000000003e-167 < z

          1. Initial program 69.2%

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

            \[\leadsto x + \color{blue}{\left(t - x\right)} \]
          3. Step-by-step derivation
            1. lower--.f6419.8

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

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

            \[\leadsto x + t \]
          6. Step-by-step derivation
            1. Applied rewrites33.7%

              \[\leadsto x + t \]

            if -8.5000000000000001e-178 < z < 5.5000000000000003e-167

            1. Initial program 69.2%

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

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

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

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

                \[\leadsto \frac{t \cdot \left(y - z\right)}{a - z} \]
              4. lower--.f6439.8

                \[\leadsto \frac{t \cdot \left(y - z\right)}{a - \color{blue}{z}} \]
            4. Applied rewrites39.8%

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

              \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{t \cdot y}{a} \]
              2. lower-*.f6416.6

                \[\leadsto \frac{t \cdot y}{a} \]
            7. Applied rewrites16.6%

              \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
          7. Recombined 2 regimes into one program.
          8. Add Preprocessing

          Alternative 13: 33.7% accurate, 4.8× speedup?

          \[\begin{array}{l} \\ x + t \end{array} \]
          (FPCore (x y z t a) :precision binary64 (+ x t))
          double code(double x, double y, double z, double t, double a) {
          	return x + t;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          use fmin_fmax_functions
              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 + t
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	return x + t;
          }
          
          def code(x, y, z, t, a):
          	return x + t
          
          function code(x, y, z, t, a)
          	return Float64(x + t)
          end
          
          function tmp = code(x, y, z, t, a)
          	tmp = x + t;
          end
          
          code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          x + t
          \end{array}
          
          Derivation
          1. Initial program 69.2%

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

            \[\leadsto x + \color{blue}{\left(t - x\right)} \]
          3. Step-by-step derivation
            1. lower--.f6419.8

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

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

            \[\leadsto x + t \]
          6. Step-by-step derivation
            1. Applied rewrites33.7%

              \[\leadsto x + t \]
            2. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025149 
            (FPCore (x y z t a)
              :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
              :precision binary64
              (+ x (/ (* (- y z) (- t x)) (- a z))))