Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B

Percentage Accurate: 75.9% → 93.3%
Time: 5.0s
Alternatives: 12
Speedup: 0.9×

Specification

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

\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\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 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: 75.9% accurate, 1.0× speedup?

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

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

Alternative 1: 93.3% accurate, 0.7× speedup?

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

\\
x + y \cdot \left(\left(1 + \frac{t}{a - t}\right) - \frac{z}{a - t}\right)
\end{array}
Derivation
  1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 91.4% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-1 \cdot \frac{a - z}{t}, y, x\right)\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
t_3 := \left(x + y\right) - \frac{y \cdot z}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-212}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+297}:\\
\;\;\;\;t\_3\\

\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-1}{\frac{a - t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or -3.99999999999999982e-212 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
      10. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1e297

    1. Initial program 75.9%

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

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

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

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

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

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{-1}{\frac{a - t}{z}} \]
      8. lift--.f6476.7

        \[\leadsto x + y \cdot \frac{-1}{\frac{a - t}{z}} \]
    9. Applied rewrites76.7%

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

Alternative 3: 89.7% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-1 \cdot \frac{a - z}{t}, y, x\right)\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
t_3 := \left(x + y\right) - \frac{y \cdot z}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-212}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+297}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or -3.99999999999999982e-212 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
      10. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1e297

    1. Initial program 75.9%

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

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

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

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

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

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
      10. distribute-neg-frac2N/A

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

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

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

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

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

Alternative 4: 89.7% accurate, 0.2× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-1}{\frac{a - t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
      10. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 75.9%

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

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

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

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

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

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{-1}{\frac{a - t}{z}} \]
      8. lift--.f6476.7

        \[\leadsto x + y \cdot \frac{-1}{\frac{a - t}{z}} \]
    9. Applied rewrites76.7%

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

Alternative 5: 89.7% accurate, 0.2× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-1}{\frac{a - t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
      10. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 75.9%

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

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

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

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

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

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{-1}{\frac{a - t}{z}} \]
      8. lift--.f6476.7

        \[\leadsto x + y \cdot \frac{-1}{\frac{a - t}{z}} \]
    9. Applied rewrites76.7%

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

Alternative 6: 89.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \left(y - \frac{y}{a - t} \cdot \left(z - t\right)\right) + x\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.99999999999999982e-212 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
      10. distribute-neg-frac2N/A

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

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

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

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

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

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

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

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

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

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

Alternative 7: 86.5% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.04999999999999996e65 or 3.60000000000000032e-36 < a

    1. Initial program 75.9%

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

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

        \[\leadsto \left(x + y\right) - \frac{y \cdot z}{\color{blue}{a}} \]
      2. lower-*.f6463.6

        \[\leadsto \left(x + y\right) - \frac{y \cdot z}{a} \]
    4. Applied rewrites63.6%

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

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

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

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

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

        \[\leadsto \left(x + y\right) - \frac{z}{a} \cdot \color{blue}{y} \]
      6. lower-/.f6465.7

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

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

    if -1.04999999999999996e65 < a < 3.60000000000000032e-36

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
      10. distribute-neg-frac2N/A

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

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

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

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

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

Alternative 8: 84.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(1, y, x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.1999999999999998e74

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
      10. distribute-neg-frac2N/A

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(1, y, x\right) \]
    11. Step-by-step derivation
      1. Applied rewrites59.0%

        \[\leadsto \mathsf{fma}\left(1, y, x\right) \]

      if -4.1999999999999998e74 < a < 1.4e-33

      1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
        10. distribute-neg-frac2N/A

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

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

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

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

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

      if 1.4e-33 < a

      1. Initial program 75.9%

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

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

          \[\leadsto \left(x + y\right) - \frac{y \cdot z}{\color{blue}{a}} \]
        2. lower-*.f6463.6

          \[\leadsto \left(x + y\right) - \frac{y \cdot z}{a} \]
      4. Applied rewrites63.6%

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

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

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

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

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

          \[\leadsto \left(x + y\right) - z \cdot \color{blue}{\frac{y}{a}} \]
        6. lower-/.f6465.7

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

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

    Alternative 9: 83.6% accurate, 0.9× speedup?

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

      1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
        10. distribute-neg-frac2N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1, y, x\right) \]
      11. Step-by-step derivation
        1. Applied rewrites59.0%

          \[\leadsto \mathsf{fma}\left(1, y, x\right) \]

        if -4.1999999999999998e74 < a < 1.00000000000000002e64

        1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
          10. distribute-neg-frac2N/A

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

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

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

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

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

      Alternative 10: 75.9% accurate, 1.1× speedup?

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

        1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
          10. distribute-neg-frac2N/A

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(1, y, x\right) \]
        11. Step-by-step derivation
          1. Applied rewrites59.0%

            \[\leadsto \mathsf{fma}\left(1, y, x\right) \]

          if -8.59999999999999957e48 < a < 1.4e-33

          1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto x + y \cdot \frac{z}{\color{blue}{t}} \]
          6. Step-by-step derivation
            1. lower-/.f6462.3

              \[\leadsto x + y \cdot \frac{z}{t} \]
          7. Applied rewrites62.3%

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

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

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

              \[\leadsto y \cdot \frac{z}{t} + x \]
            4. *-commutativeN/A

              \[\leadsto \frac{z}{t} \cdot y + x \]
            5. lower-fma.f6462.3

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

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

        Alternative 11: 61.5% accurate, 0.4× speedup?

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

          1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\frac{z}{a - t}\right), y, x\right) \]
            10. distribute-neg-frac2N/A

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(1, y, x\right) \]
          11. Step-by-step derivation
            1. Applied rewrites59.0%

              \[\leadsto \mathsf{fma}\left(1, y, x\right) \]

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

            1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(1 + \frac{y - \color{blue}{\frac{y}{a - t} \cdot \left(z - t\right)}}{x}\right) \cdot x \]
              14. lower-/.f6479.0

                \[\leadsto \left(1 + \frac{y - \color{blue}{\frac{y}{a - t}} \cdot \left(z - t\right)}{x}\right) \cdot x \]
            3. Applied rewrites79.0%

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

              \[\leadsto \color{blue}{1} \cdot x \]
            5. Step-by-step derivation
              1. Applied rewrites50.3%

                \[\leadsto \color{blue}{1} \cdot x \]
            6. Recombined 2 regimes into one program.
            7. Add Preprocessing

            Alternative 12: 50.3% accurate, 4.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(1 + \frac{y - \color{blue}{\frac{y}{a - t} \cdot \left(z - t\right)}}{x}\right) \cdot x \]
              14. lower-/.f6479.0

                \[\leadsto \left(1 + \frac{y - \color{blue}{\frac{y}{a - t}} \cdot \left(z - t\right)}{x}\right) \cdot x \]
            3. Applied rewrites79.0%

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

              \[\leadsto \color{blue}{1} \cdot x \]
            5. Step-by-step derivation
              1. Applied rewrites50.3%

                \[\leadsto \color{blue}{1} \cdot x \]
              2. Add Preprocessing

              Reproduce

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