Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A

Percentage Accurate: 85.0% → 98.3%
Time: 3.7s
Alternatives: 12
Speedup: 1.0×

Specification

?
\[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a):
	return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + ((y * (z - t)) / (z - a));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - t\right)}{z - a}

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

\[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a):
	return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + ((y * (z - t)) / (z - a));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - t\right)}{z - a}

Alternative 1: 98.3% accurate, 1.0× speedup?

\[\mathsf{fma}\left(\frac{t - z}{a - z}, y, x\right) \]
(FPCore (x y z t a) :precision binary64 (fma (/ (- t z) (- a z)) y x))
double code(double x, double y, double z, double t, double a) {
	return fma(((t - z) / (a - z)), y, x);
}
function code(x, y, z, t, a)
	return fma(Float64(Float64(t - z) / Float64(a - z)), y, x)
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\mathsf{fma}\left(\frac{t - z}{a - z}, y, x\right)
Derivation
  1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.8% accurate, 1.0× speedup?

\[\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right) \]
(FPCore (x y z t a) :precision binary64 (fma (/ y (- z a)) (- z t) x))
double code(double x, double y, double z, double t, double a) {
	return fma((y / (z - a)), (z - t), x);
}
function code(x, y, z, t, a)
	return fma(Float64(y / Float64(z - a)), Float64(z - t), x)
end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]
\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)
Derivation
  1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 83.8% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+53}:\\ \;\;\;\;\frac{z - t}{z - a} \cdot y\\ \mathbf{elif}\;t\_1 \leq 10^{-12}:\\ \;\;\;\;x + \frac{y \cdot z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z - a} \cdot \left(z - t\right)\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- z a))))
   (if (<= t_1 -1e+53)
     (* (/ (- z t) (- z a)) y)
     (if (<= t_1 1e-12) (+ x (/ (* y z) (- z a))) (* (/ y (- z a)) (- z t))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if (t_1 <= -1e+53) {
		tmp = ((z - t) / (z - a)) * y;
	} else if (t_1 <= 1e-12) {
		tmp = x + ((y * z) / (z - a));
	} else {
		tmp = (y / (z - a)) * (z - 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) :: t_1
    real(8) :: tmp
    t_1 = (y * (z - t)) / (z - a)
    if (t_1 <= (-1d+53)) then
        tmp = ((z - t) / (z - a)) * y
    else if (t_1 <= 1d-12) then
        tmp = x + ((y * z) / (z - a))
    else
        tmp = (y / (z - a)) * (z - t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if (t_1 <= -1e+53) {
		tmp = ((z - t) / (z - a)) * y;
	} else if (t_1 <= 1e-12) {
		tmp = x + ((y * z) / (z - a));
	} else {
		tmp = (y / (z - a)) * (z - t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / (z - a)
	tmp = 0
	if t_1 <= -1e+53:
		tmp = ((z - t) / (z - a)) * y
	elif t_1 <= 1e-12:
		tmp = x + ((y * z) / (z - a))
	else:
		tmp = (y / (z - a)) * (z - t)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a))
	tmp = 0.0
	if (t_1 <= -1e+53)
		tmp = Float64(Float64(Float64(z - t) / Float64(z - a)) * y);
	elseif (t_1 <= 1e-12)
		tmp = Float64(x + Float64(Float64(y * z) / Float64(z - a)));
	else
		tmp = Float64(Float64(y / Float64(z - a)) * Float64(z - t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (z - t)) / (z - a);
	tmp = 0.0;
	if (t_1 <= -1e+53)
		tmp = ((z - t) / (z - a)) * y;
	elseif (t_1 <= 1e-12)
		tmp = x + ((y * z) / (z - a));
	else
		tmp = (y / (z - a)) * (z - t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+53], N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 1e-12], N[(x + N[(N[(y * z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+53}:\\
\;\;\;\;\frac{z - t}{z - a} \cdot y\\

\mathbf{elif}\;t\_1 \leq 10^{-12}:\\
\;\;\;\;x + \frac{y \cdot z}{z - a}\\

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


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

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
      6. sub-negate-revN/A

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

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

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

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

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

        \[\leadsto \frac{t - z}{a - z} \cdot y \]
      12. lift-/.f64N/A

        \[\leadsto \frac{t - z}{a - z} \cdot y \]
      13. lower-*.f6450.2%

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

        \[\leadsto \frac{t - z}{a - z} \cdot y \]
      15. frac-2negN/A

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

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

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

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

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

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
      21. lift--.f64N/A

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
      22. lower-/.f6450.2%

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
    6. Applied rewrites50.2%

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

    if -9.9999999999999999e52 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.9999999999999998e-13

    1. Initial program 85.0%

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

      \[\leadsto x + \frac{\color{blue}{y \cdot z}}{z - a} \]
    3. Step-by-step derivation
      1. lower-*.f6462.0%

        \[\leadsto x + \frac{y \cdot \color{blue}{z}}{z - a} \]
    4. Applied rewrites62.0%

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

    if 9.9999999999999998e-13 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{z - a} \cdot \left(\color{blue}{z} - t\right) \]
      9. lower-/.f6447.7%

        \[\leadsto \frac{y}{z - a} \cdot \left(\color{blue}{z} - t\right) \]
    6. Applied rewrites47.7%

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

Alternative 4: 83.5% accurate, 0.4× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -9.99999999999999983e76 or 3.99999999999999998e89 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
      6. sub-negate-revN/A

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

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

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

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

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

        \[\leadsto \frac{t - z}{a - z} \cdot y \]
      12. lift-/.f64N/A

        \[\leadsto \frac{t - z}{a - z} \cdot y \]
      13. lower-*.f6450.2%

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

        \[\leadsto \frac{t - z}{a - z} \cdot y \]
      15. frac-2negN/A

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

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

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

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

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

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
      21. lift--.f64N/A

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
      22. lower-/.f6450.2%

        \[\leadsto \frac{z - t}{z - a} \cdot y \]
    6. Applied rewrites50.2%

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

    if -9.99999999999999983e76 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 3.99999999999999998e89

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 83.1% accurate, 0.4× speedup?

    \[\begin{array}{l} t_1 := \frac{y}{z - a} \cdot \left(z - t\right)\\ t_2 := \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+77}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+89}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a - z}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (* (/ y (- z a)) (- z t))) (t_2 (/ (* y (- z t)) (- z a))))
       (if (<= t_2 -1e+77) t_1 (if (<= t_2 4e+89) (fma (/ t (- a z)) y x) t_1))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = (y / (z - a)) * (z - t);
    	double t_2 = (y * (z - t)) / (z - a);
    	double tmp;
    	if (t_2 <= -1e+77) {
    		tmp = t_1;
    	} else if (t_2 <= 4e+89) {
    		tmp = fma((t / (a - z)), y, x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a)
    	t_1 = Float64(Float64(y / Float64(z - a)) * Float64(z - t))
    	t_2 = Float64(Float64(y * Float64(z - t)) / Float64(z - a))
    	tmp = 0.0
    	if (t_2 <= -1e+77)
    		tmp = t_1;
    	elseif (t_2 <= 4e+89)
    		tmp = fma(Float64(t / Float64(a - z)), y, x);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+77], t$95$1, If[LessEqual[t$95$2, 4e+89], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    t_1 := \frac{y}{z - a} \cdot \left(z - t\right)\\
    t_2 := \frac{y \cdot \left(z - t\right)}{z - a}\\
    \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+77}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+89}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{t}{a - z}, y, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -9.99999999999999983e76 or 3.99999999999999998e89 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

      1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{y}{z - a} \cdot \left(\color{blue}{z} - t\right) \]
        9. lower-/.f6447.7%

          \[\leadsto \frac{y}{z - a} \cdot \left(\color{blue}{z} - t\right) \]
      6. Applied rewrites47.7%

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

      if -9.99999999999999983e76 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 3.99999999999999998e89

      1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 6: 82.6% accurate, 0.8× speedup?

      \[\begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{+171}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+163}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a - z}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (if (<= z -1.02e+171)
         (+ x y)
         (if (<= z 4.6e+163) (fma (/ t (- a z)) y x) (+ x y))))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (z <= -1.02e+171) {
      		tmp = x + y;
      	} else if (z <= 4.6e+163) {
      		tmp = fma((t / (a - z)), y, x);
      	} else {
      		tmp = x + y;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (z <= -1.02e+171)
      		tmp = Float64(x + y);
      	elseif (z <= 4.6e+163)
      		tmp = fma(Float64(t / Float64(a - z)), y, x);
      	else
      		tmp = Float64(x + y);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.02e+171], N[(x + y), $MachinePrecision], If[LessEqual[z, 4.6e+163], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(x + y), $MachinePrecision]]]
      
      \begin{array}{l}
      \mathbf{if}\;z \leq -1.02 \cdot 10^{+171}:\\
      \;\;\;\;x + y\\
      
      \mathbf{elif}\;z \leq 4.6 \cdot 10^{+163}:\\
      \;\;\;\;\mathsf{fma}\left(\frac{t}{a - z}, y, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x + y\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.02e171 or 4.60000000000000003e163 < z

        1. Initial program 85.0%

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

          \[\leadsto \color{blue}{x + y} \]
        3. Step-by-step derivation
          1. lower-+.f6460.8%

            \[\leadsto x + \color{blue}{y} \]
        4. Applied rewrites60.8%

          \[\leadsto \color{blue}{x + y} \]

        if -1.02e171 < z < 4.60000000000000003e163

        1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 7: 78.8% accurate, 0.8× speedup?

        \[\begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+53}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+39}:\\ \;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (if (<= z -2.6e+53)
           (+ x y)
           (if (<= z 5.5e+39) (fma (- t z) (/ y a) x) (+ x y))))
        double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if (z <= -2.6e+53) {
        		tmp = x + y;
        	} else if (z <= 5.5e+39) {
        		tmp = fma((t - z), (y / a), x);
        	} else {
        		tmp = x + y;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a)
        	tmp = 0.0
        	if (z <= -2.6e+53)
        		tmp = Float64(x + y);
        	elseif (z <= 5.5e+39)
        		tmp = fma(Float64(t - z), Float64(y / a), x);
        	else
        		tmp = Float64(x + y);
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e+53], N[(x + y), $MachinePrecision], If[LessEqual[z, 5.5e+39], N[(N[(t - z), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(x + y), $MachinePrecision]]]
        
        \begin{array}{l}
        \mathbf{if}\;z \leq -2.6 \cdot 10^{+53}:\\
        \;\;\;\;x + y\\
        
        \mathbf{elif}\;z \leq 5.5 \cdot 10^{+39}:\\
        \;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{a}, x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;x + y\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -2.59999999999999998e53 or 5.4999999999999997e39 < z

          1. Initial program 85.0%

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

            \[\leadsto \color{blue}{x + y} \]
          3. Step-by-step derivation
            1. lower-+.f6460.8%

              \[\leadsto x + \color{blue}{y} \]
          4. Applied rewrites60.8%

            \[\leadsto \color{blue}{x + y} \]

          if -2.59999999999999998e53 < z < 5.4999999999999997e39

          1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 8: 77.6% accurate, 0.9× speedup?

          \[\begin{array}{l} \mathbf{if}\;z \leq -2.75 \cdot 10^{+40}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+46}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (if (<= z -2.75e+40) (+ x y) (if (<= z 7.5e+46) (fma (/ t a) y x) (+ x y))))
          double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if (z <= -2.75e+40) {
          		tmp = x + y;
          	} else if (z <= 7.5e+46) {
          		tmp = fma((t / a), y, x);
          	} else {
          		tmp = x + y;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a)
          	tmp = 0.0
          	if (z <= -2.75e+40)
          		tmp = Float64(x + y);
          	elseif (z <= 7.5e+46)
          		tmp = fma(Float64(t / a), y, x);
          	else
          		tmp = Float64(x + y);
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.75e+40], N[(x + y), $MachinePrecision], If[LessEqual[z, 7.5e+46], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], N[(x + y), $MachinePrecision]]]
          
          \begin{array}{l}
          \mathbf{if}\;z \leq -2.75 \cdot 10^{+40}:\\
          \;\;\;\;x + y\\
          
          \mathbf{elif}\;z \leq 7.5 \cdot 10^{+46}:\\
          \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;x + y\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -2.74999999999999987e40 or 7.5000000000000003e46 < z

            1. Initial program 85.0%

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

              \[\leadsto \color{blue}{x + y} \]
            3. Step-by-step derivation
              1. lower-+.f6460.8%

                \[\leadsto x + \color{blue}{y} \]
            4. Applied rewrites60.8%

              \[\leadsto \color{blue}{x + y} \]

            if -2.74999999999999987e40 < z < 7.5000000000000003e46

            1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 9: 61.6% accurate, 1.0× speedup?

          \[\begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-210}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-274}:\\ \;\;\;\;\frac{y}{a} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (if (<= z -1.7e-210) (+ x y) (if (<= z 1.32e-274) (* (/ y a) t) (+ x y))))
          double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if (z <= -1.7e-210) {
          		tmp = x + y;
          	} else if (z <= 1.32e-274) {
          		tmp = (y / a) * t;
          	} else {
          		tmp = x + y;
          	}
          	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.7d-210)) then
                  tmp = x + y
              else if (z <= 1.32d-274) then
                  tmp = (y / a) * t
              else
                  tmp = x + y
              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.7e-210) {
          		tmp = x + y;
          	} else if (z <= 1.32e-274) {
          		tmp = (y / a) * t;
          	} else {
          		tmp = x + y;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	tmp = 0
          	if z <= -1.7e-210:
          		tmp = x + y
          	elif z <= 1.32e-274:
          		tmp = (y / a) * t
          	else:
          		tmp = x + y
          	return tmp
          
          function code(x, y, z, t, a)
          	tmp = 0.0
          	if (z <= -1.7e-210)
          		tmp = Float64(x + y);
          	elseif (z <= 1.32e-274)
          		tmp = Float64(Float64(y / a) * t);
          	else
          		tmp = Float64(x + y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	tmp = 0.0;
          	if (z <= -1.7e-210)
          		tmp = x + y;
          	elseif (z <= 1.32e-274)
          		tmp = (y / a) * t;
          	else
          		tmp = x + y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e-210], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.32e-274], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], N[(x + y), $MachinePrecision]]]
          
          \begin{array}{l}
          \mathbf{if}\;z \leq -1.7 \cdot 10^{-210}:\\
          \;\;\;\;x + y\\
          
          \mathbf{elif}\;z \leq 1.32 \cdot 10^{-274}:\\
          \;\;\;\;\frac{y}{a} \cdot t\\
          
          \mathbf{else}:\\
          \;\;\;\;x + y\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -1.69999999999999987e-210 or 1.32e-274 < z

            1. Initial program 85.0%

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

              \[\leadsto \color{blue}{x + y} \]
            3. Step-by-step derivation
              1. lower-+.f6460.8%

                \[\leadsto x + \color{blue}{y} \]
            4. Applied rewrites60.8%

              \[\leadsto \color{blue}{x + y} \]

            if -1.69999999999999987e-210 < z < 1.32e-274

            1. Initial program 85.0%

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}} \]
            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-*.f6418.9%

                \[\leadsto \frac{t \cdot y}{a} \]
            7. Applied rewrites18.9%

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

                \[\leadsto \frac{t \cdot y}{a} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{t \cdot y}{a} \]
              3. associate-/l*N/A

                \[\leadsto t \cdot \frac{y}{\color{blue}{a}} \]
              4. *-commutativeN/A

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

                \[\leadsto \frac{y}{a} \cdot t \]
              6. lower-/.f6420.5%

                \[\leadsto \frac{y}{a} \cdot t \]
            9. Applied rewrites20.5%

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

          Alternative 10: 61.5% accurate, 1.0× speedup?

          \[\begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-210}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-274}:\\ \;\;\;\;\frac{t}{a} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (if (<= z -1.7e-210) (+ x y) (if (<= z 1.32e-274) (* (/ t a) y) (+ x y))))
          double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if (z <= -1.7e-210) {
          		tmp = x + y;
          	} else if (z <= 1.32e-274) {
          		tmp = (t / a) * y;
          	} else {
          		tmp = x + y;
          	}
          	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.7d-210)) then
                  tmp = x + y
              else if (z <= 1.32d-274) then
                  tmp = (t / a) * y
              else
                  tmp = x + y
              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.7e-210) {
          		tmp = x + y;
          	} else if (z <= 1.32e-274) {
          		tmp = (t / a) * y;
          	} else {
          		tmp = x + y;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	tmp = 0
          	if z <= -1.7e-210:
          		tmp = x + y
          	elif z <= 1.32e-274:
          		tmp = (t / a) * y
          	else:
          		tmp = x + y
          	return tmp
          
          function code(x, y, z, t, a)
          	tmp = 0.0
          	if (z <= -1.7e-210)
          		tmp = Float64(x + y);
          	elseif (z <= 1.32e-274)
          		tmp = Float64(Float64(t / a) * y);
          	else
          		tmp = Float64(x + y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	tmp = 0.0;
          	if (z <= -1.7e-210)
          		tmp = x + y;
          	elseif (z <= 1.32e-274)
          		tmp = (t / a) * y;
          	else
          		tmp = x + y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e-210], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.32e-274], N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision], N[(x + y), $MachinePrecision]]]
          
          \begin{array}{l}
          \mathbf{if}\;z \leq -1.7 \cdot 10^{-210}:\\
          \;\;\;\;x + y\\
          
          \mathbf{elif}\;z \leq 1.32 \cdot 10^{-274}:\\
          \;\;\;\;\frac{t}{a} \cdot y\\
          
          \mathbf{else}:\\
          \;\;\;\;x + y\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -1.69999999999999987e-210 or 1.32e-274 < z

            1. Initial program 85.0%

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

              \[\leadsto \color{blue}{x + y} \]
            3. Step-by-step derivation
              1. lower-+.f6460.8%

                \[\leadsto x + \color{blue}{y} \]
            4. Applied rewrites60.8%

              \[\leadsto \color{blue}{x + y} \]

            if -1.69999999999999987e-210 < z < 1.32e-274

            1. Initial program 85.0%

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}} \]
            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-*.f6418.9%

                \[\leadsto \frac{t \cdot y}{a} \]
            7. Applied rewrites18.9%

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

                \[\leadsto \frac{t \cdot y}{a} \]
              2. mult-flipN/A

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

                \[\leadsto \left(t \cdot y\right) \cdot \frac{1}{a} \]
              4. *-commutativeN/A

                \[\leadsto \left(y \cdot t\right) \cdot \frac{1}{a} \]
              5. associate-*l*N/A

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

                \[\leadsto \left(t \cdot \frac{1}{a}\right) \cdot y \]
              7. lower-*.f64N/A

                \[\leadsto \left(t \cdot \frac{1}{a}\right) \cdot y \]
              8. mult-flip-revN/A

                \[\leadsto \frac{t}{a} \cdot y \]
              9. lower-/.f6420.9%

                \[\leadsto \frac{t}{a} \cdot y \]
            9. Applied rewrites20.9%

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

          Alternative 11: 60.8% accurate, 4.1× speedup?

          \[x + y \]
          (FPCore (x y z t a) :precision binary64 (+ x y))
          double code(double x, double y, double z, double t, double a) {
          	return x + y;
          }
          
          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
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	return x + y;
          }
          
          def code(x, y, z, t, a):
          	return x + y
          
          function code(x, y, z, t, a)
          	return Float64(x + y)
          end
          
          function tmp = code(x, y, z, t, a)
          	tmp = x + y;
          end
          
          code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
          
          x + y
          
          Derivation
          1. Initial program 85.0%

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

            \[\leadsto \color{blue}{x + y} \]
          3. Step-by-step derivation
            1. lower-+.f6460.8%

              \[\leadsto x + \color{blue}{y} \]
          4. Applied rewrites60.8%

            \[\leadsto \color{blue}{x + y} \]
          5. Add Preprocessing

          Alternative 12: 19.2% accurate, 15.3× speedup?

          \[y \]
          (FPCore (x y z t a) :precision binary64 y)
          double code(double x, double y, double z, double t, double a) {
          	return y;
          }
          
          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 = y
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	return y;
          }
          
          def code(x, y, z, t, a):
          	return y
          
          function code(x, y, z, t, a)
          	return y
          end
          
          function tmp = code(x, y, z, t, a)
          	tmp = y;
          end
          
          code[x_, y_, z_, t_, a_] := y
          
          y
          
          Derivation
          1. Initial program 85.0%

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

            \[\leadsto \color{blue}{x + y} \]
          3. Step-by-step derivation
            1. lower-+.f6460.8%

              \[\leadsto x + \color{blue}{y} \]
          4. Applied rewrites60.8%

            \[\leadsto \color{blue}{x + y} \]
          5. Taylor expanded in x around 0

            \[\leadsto y \]
          6. Step-by-step derivation
            1. Applied rewrites19.2%

              \[\leadsto y \]
            2. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025188 
            (FPCore (x y z t a)
              :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
              :precision binary64
              (+ x (/ (* y (- z t)) (- z a))))