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

Percentage Accurate: 77.6% → 92.1%
Time: 4.0s
Alternatives: 14
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 14 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: 77.6% 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: 92.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-252}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - a}{t}, 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))) < -4.99999999999999973e-202 or 5.00000000000000008e-252 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))

    1. Initial program 77.6%

      \[\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-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999973e-202 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 5.00000000000000008e-252

    1. Initial program 77.6%

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

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

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

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

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

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

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
      6. lower-*.f6457.2

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
    4. Applied rewrites57.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{-118}:\\
\;\;\;\;x - \left(\frac{y}{t - a} \cdot \left(t - z\right) - y\right)\\

\mathbf{elif}\;a \leq 3.7 \cdot 10^{-153}:\\
\;\;\;\;x + -1 \cdot \frac{a \cdot y - y \cdot z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.79999999999999961e-118

    1. Initial program 77.6%

      \[\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. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.79999999999999961e-118 < a < 3.7000000000000003e-153

    1. Initial program 77.6%

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

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

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

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

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

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

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
      6. lower-*.f6457.2

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
    4. Applied rewrites57.2%

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

    if 3.7000000000000003e-153 < a

    1. Initial program 77.6%

      \[\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 \left(x + y\right) - \color{blue}{\frac{\left(z - t\right) \cdot y}{a - t}} \]
      3. sub-to-fractionN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{-118}:\\
\;\;\;\;x - \left(\frac{y}{t - a} \cdot \left(t - z\right) - y\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.79999999999999961e-118

    1. Initial program 77.6%

      \[\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. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.79999999999999961e-118 < a < 3.7000000000000003e-153

    1. Initial program 77.6%

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

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

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

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

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

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

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
      6. lower-*.f6457.2

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
    4. Applied rewrites57.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7000000000000003e-153 < a

    1. Initial program 77.6%

      \[\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 \left(x + y\right) - \color{blue}{\frac{\left(z - t\right) \cdot y}{a - t}} \]
      3. sub-to-fractionN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 86.1% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 77.6%

      \[\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. sub-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000002e22 < a < 3.09999999999999995e-153

    1. Initial program 77.6%

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

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

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

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

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

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

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
      6. lower-*.f6457.2

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
    4. Applied rewrites57.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.09999999999999995e-153 < a

    1. Initial program 77.6%

      \[\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 \left(x + y\right) - \color{blue}{\frac{\left(z - t\right) \cdot y}{a - t}} \]
      3. sub-to-fractionN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 85.8% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9000000000000002e22 or 3.09999999999999995e-153 < a

    1. Initial program 77.6%

      \[\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. sub-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000002e22 < a < 3.09999999999999995e-153

    1. Initial program 77.6%

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

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

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

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

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

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

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
      6. lower-*.f6457.2

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
    4. Applied rewrites57.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 83.2% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.1500000000000001e22 or 5.49999999999999975e-50 < a

    1. Initial program 77.6%

      \[\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-*.f6465.8

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

      \[\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-/.f6467.6

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

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

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

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

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

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

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

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

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

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

    if -3.1500000000000001e22 < a < 5.49999999999999975e-50

    1. Initial program 77.6%

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

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

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

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

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

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

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
      6. lower-*.f6457.2

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
    4. Applied rewrites57.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 78.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := y - -1 \cdot x\\
\mathbf{if}\;a \leq -1.66 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.6600000000000001e25 or 4.0500000000000002e-47 < a

    1. Initial program 77.6%

      \[\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-*.f6465.8

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

      \[\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-/.f6467.6

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot x} \]
    10. Step-by-step derivation
      1. lower-*.f6460.9

        \[\leadsto y - -1 \cdot \color{blue}{x} \]
    11. Applied rewrites60.9%

      \[\leadsto y - \color{blue}{-1 \cdot x} \]

    if -1.6600000000000001e25 < a < 4.0500000000000002e-47

    1. Initial program 77.6%

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

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

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

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

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

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

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
      6. lower-*.f6457.2

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
    4. Applied rewrites57.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 76.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y - -1 \cdot x\\ \mathbf{if}\;a \leq -9 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{-47}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- y (* -1.0 x))))
   (if (<= a -9e+22) t_1 (if (<= a 3.7e-47) (+ x (/ (* y z) t)) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y - (-1.0 * x);
	double tmp;
	if (a <= -9e+22) {
		tmp = t_1;
	} else if (a <= 3.7e-47) {
		tmp = x + ((y * z) / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y - ((-1.0d0) * x)
    if (a <= (-9d+22)) then
        tmp = t_1
    else if (a <= 3.7d-47) then
        tmp = x + ((y * z) / t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y - (-1.0 * x);
	double tmp;
	if (a <= -9e+22) {
		tmp = t_1;
	} else if (a <= 3.7e-47) {
		tmp = x + ((y * z) / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y - (-1.0 * x)
	tmp = 0
	if a <= -9e+22:
		tmp = t_1
	elif a <= 3.7e-47:
		tmp = x + ((y * z) / t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y - Float64(-1.0 * x))
	tmp = 0.0
	if (a <= -9e+22)
		tmp = t_1;
	elseif (a <= 3.7e-47)
		tmp = Float64(x + Float64(Float64(y * z) / t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y - (-1.0 * x);
	tmp = 0.0;
	if (a <= -9e+22)
		tmp = t_1;
	elseif (a <= 3.7e-47)
		tmp = x + ((y * z) / t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(-1.0 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9e+22], t$95$1, If[LessEqual[a, 3.7e-47], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y - -1 \cdot x\\
\mathbf{if}\;a \leq -9 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 77.6%

      \[\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-*.f6465.8

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

      \[\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-/.f6467.6

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot x} \]
    10. Step-by-step derivation
      1. lower-*.f6460.9

        \[\leadsto y - -1 \cdot \color{blue}{x} \]
    11. Applied rewrites60.9%

      \[\leadsto y - \color{blue}{-1 \cdot x} \]

    if -8.9999999999999996e22 < a < 3.7e-47

    1. Initial program 77.6%

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

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

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

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

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

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

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
      6. lower-*.f6457.2

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
    4. Applied rewrites57.2%

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

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

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

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

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

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

Alternative 9: 69.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{t - a} \cdot z\\ t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\ t_3 := y - -1 \cdot x\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-146}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-252}:\\ \;\;\;\;x + \left(y + -1 \cdot y\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+270}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ y (- t a)) z))
        (t_2 (- (+ x y) (/ (* (- z t) y) (- a t))))
        (t_3 (- y (* -1.0 x))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -1e-146)
       t_3
       (if (<= t_2 5e-252)
         (+ x (+ y (* -1.0 y)))
         (if (<= t_2 2e+270) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / (t - a)) * z;
	double t_2 = (x + y) - (((z - t) * y) / (a - t));
	double t_3 = y - (-1.0 * x);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -1e-146) {
		tmp = t_3;
	} else if (t_2 <= 5e-252) {
		tmp = x + (y + (-1.0 * y));
	} else if (t_2 <= 2e+270) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y / (t - a)) * z;
	double t_2 = (x + y) - (((z - t) * y) / (a - t));
	double t_3 = y - (-1.0 * x);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -1e-146) {
		tmp = t_3;
	} else if (t_2 <= 5e-252) {
		tmp = x + (y + (-1.0 * y));
	} else if (t_2 <= 2e+270) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y / (t - a)) * z
	t_2 = (x + y) - (((z - t) * y) / (a - t))
	t_3 = y - (-1.0 * x)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -1e-146:
		tmp = t_3
	elif t_2 <= 5e-252:
		tmp = x + (y + (-1.0 * y))
	elif t_2 <= 2e+270:
		tmp = t_3
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y / Float64(t - a)) * z)
	t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t)))
	t_3 = Float64(y - Float64(-1.0 * x))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -1e-146)
		tmp = t_3;
	elseif (t_2 <= 5e-252)
		tmp = Float64(x + Float64(y + Float64(-1.0 * y)));
	elseif (t_2 <= 2e+270)
		tmp = t_3;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y / (t - a)) * z;
	t_2 = (x + y) - (((z - t) * y) / (a - t));
	t_3 = y - (-1.0 * x);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -1e-146)
		tmp = t_3;
	elseif (t_2 <= 5e-252)
		tmp = x + (y + (-1.0 * y));
	elseif (t_2 <= 2e+270)
		tmp = t_3;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] * z), $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[(y - N[(-1.0 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-146], t$95$3, If[LessEqual[t$95$2, 5e-252], N[(x + N[(y + N[(-1.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+270], t$95$3, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-146}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-252}:\\
\;\;\;\;x + \left(y + -1 \cdot y\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+270}:\\
\;\;\;\;t\_3\\

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


\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 2.0000000000000001e270 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))

    1. Initial program 77.6%

      \[\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-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{t} - a} \]
      3. lower--.f6426.4

        \[\leadsto \frac{y \cdot z}{t - \color{blue}{a}} \]
    6. Applied rewrites26.4%

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.00000000000000003e-146 or 5.00000000000000008e-252 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 2.0000000000000001e270

    1. Initial program 77.6%

      \[\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-*.f6465.8

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

      \[\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-/.f6467.6

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot x} \]
    10. Step-by-step derivation
      1. lower-*.f6460.9

        \[\leadsto y - -1 \cdot \color{blue}{x} \]
    11. Applied rewrites60.9%

      \[\leadsto y - \color{blue}{-1 \cdot x} \]

    if -1.00000000000000003e-146 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 5.00000000000000008e-252

    1. Initial program 77.6%

      \[\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-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(y + \color{blue}{-1 \cdot y}\right) \]
      3. lower-*.f6451.3

        \[\leadsto x + \left(y + -1 \cdot \color{blue}{y}\right) \]
    6. Applied rewrites51.3%

      \[\leadsto \color{blue}{x + \left(y + -1 \cdot y\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 64.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y - -1 \cdot x\\ \mathbf{if}\;a \leq -6 \cdot 10^{+21}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-43}:\\ \;\;\;\;x + \left(y + -1 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- y (* -1.0 x))))
   (if (<= a -6e+21) t_1 (if (<= a 1.4e-43) (+ x (+ y (* -1.0 y))) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y - (-1.0 * x);
	double tmp;
	if (a <= -6e+21) {
		tmp = t_1;
	} else if (a <= 1.4e-43) {
		tmp = x + (y + (-1.0 * y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y - ((-1.0d0) * x)
    if (a <= (-6d+21)) then
        tmp = t_1
    else if (a <= 1.4d-43) then
        tmp = x + (y + ((-1.0d0) * y))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y - (-1.0 * x);
	double tmp;
	if (a <= -6e+21) {
		tmp = t_1;
	} else if (a <= 1.4e-43) {
		tmp = x + (y + (-1.0 * y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y - (-1.0 * x)
	tmp = 0
	if a <= -6e+21:
		tmp = t_1
	elif a <= 1.4e-43:
		tmp = x + (y + (-1.0 * y))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y - Float64(-1.0 * x))
	tmp = 0.0
	if (a <= -6e+21)
		tmp = t_1;
	elseif (a <= 1.4e-43)
		tmp = Float64(x + Float64(y + Float64(-1.0 * y)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y - (-1.0 * x);
	tmp = 0.0;
	if (a <= -6e+21)
		tmp = t_1;
	elseif (a <= 1.4e-43)
		tmp = x + (y + (-1.0 * y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(-1.0 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6e+21], t$95$1, If[LessEqual[a, 1.4e-43], N[(x + N[(y + N[(-1.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y - -1 \cdot x\\
\mathbf{if}\;a \leq -6 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.4 \cdot 10^{-43}:\\
\;\;\;\;x + \left(y + -1 \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6e21 or 1.3999999999999999e-43 < a

    1. Initial program 77.6%

      \[\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-*.f6465.8

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

      \[\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-/.f6467.6

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot x} \]
    10. Step-by-step derivation
      1. lower-*.f6460.9

        \[\leadsto y - -1 \cdot \color{blue}{x} \]
    11. Applied rewrites60.9%

      \[\leadsto y - \color{blue}{-1 \cdot x} \]

    if -6e21 < a < 1.3999999999999999e-43

    1. Initial program 77.6%

      \[\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-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(y + \color{blue}{-1 \cdot y}\right) \]
      3. lower-*.f6451.3

        \[\leadsto x + \left(y + -1 \cdot \color{blue}{y}\right) \]
    6. Applied rewrites51.3%

      \[\leadsto \color{blue}{x + \left(y + -1 \cdot y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 60.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y - -1 \cdot x\\ \mathbf{if}\;a \leq -1.36 \cdot 10^{-49}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.05 \cdot 10^{-210}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- y (* -1.0 x))))
   (if (<= a -1.36e-49) t_1 (if (<= a 2.05e-210) (/ (* y z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y - (-1.0 * x);
	double tmp;
	if (a <= -1.36e-49) {
		tmp = t_1;
	} else if (a <= 2.05e-210) {
		tmp = (y * z) / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y - ((-1.0d0) * x)
    if (a <= (-1.36d-49)) then
        tmp = t_1
    else if (a <= 2.05d-210) then
        tmp = (y * z) / t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y - (-1.0 * x);
	double tmp;
	if (a <= -1.36e-49) {
		tmp = t_1;
	} else if (a <= 2.05e-210) {
		tmp = (y * z) / t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y - (-1.0 * x)
	tmp = 0
	if a <= -1.36e-49:
		tmp = t_1
	elif a <= 2.05e-210:
		tmp = (y * z) / t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y - Float64(-1.0 * x))
	tmp = 0.0
	if (a <= -1.36e-49)
		tmp = t_1;
	elseif (a <= 2.05e-210)
		tmp = Float64(Float64(y * z) / t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y - (-1.0 * x);
	tmp = 0.0;
	if (a <= -1.36e-49)
		tmp = t_1;
	elseif (a <= 2.05e-210)
		tmp = (y * z) / t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(-1.0 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.36e-49], t$95$1, If[LessEqual[a, 2.05e-210], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y - -1 \cdot x\\
\mathbf{if}\;a \leq -1.36 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 2.05 \cdot 10^{-210}:\\
\;\;\;\;\frac{y \cdot z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.36000000000000006e-49 or 2.04999999999999995e-210 < a

    1. Initial program 77.6%

      \[\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-*.f6465.8

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

      \[\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-/.f6467.6

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot x} \]
    10. Step-by-step derivation
      1. lower-*.f6460.9

        \[\leadsto y - -1 \cdot \color{blue}{x} \]
    11. Applied rewrites60.9%

      \[\leadsto y - \color{blue}{-1 \cdot x} \]

    if -1.36000000000000006e-49 < a < 2.04999999999999995e-210

    1. Initial program 77.6%

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

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

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

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

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

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

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
      6. lower-*.f6457.2

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
    4. Applied rewrites57.2%

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

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

        \[\leadsto \frac{y \cdot z}{t} \]
      2. lower-*.f6418.2

        \[\leadsto \frac{y \cdot z}{t} \]
    7. Applied rewrites18.2%

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

Alternative 12: 59.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y - -1 \cdot x\\ \mathbf{if}\;a \leq -1.36 \cdot 10^{-49}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-209}:\\ \;\;\;\;\frac{y}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- y (* -1.0 x))))
   (if (<= a -1.36e-49) t_1 (if (<= a 5.8e-209) (* (/ y t) z) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y - (-1.0 * x);
	double tmp;
	if (a <= -1.36e-49) {
		tmp = t_1;
	} else if (a <= 5.8e-209) {
		tmp = (y / t) * z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y - ((-1.0d0) * x)
    if (a <= (-1.36d-49)) then
        tmp = t_1
    else if (a <= 5.8d-209) then
        tmp = (y / t) * z
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y - (-1.0 * x);
	double tmp;
	if (a <= -1.36e-49) {
		tmp = t_1;
	} else if (a <= 5.8e-209) {
		tmp = (y / t) * z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y - (-1.0 * x)
	tmp = 0
	if a <= -1.36e-49:
		tmp = t_1
	elif a <= 5.8e-209:
		tmp = (y / t) * z
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y - Float64(-1.0 * x))
	tmp = 0.0
	if (a <= -1.36e-49)
		tmp = t_1;
	elseif (a <= 5.8e-209)
		tmp = Float64(Float64(y / t) * z);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y - (-1.0 * x);
	tmp = 0.0;
	if (a <= -1.36e-49)
		tmp = t_1;
	elseif (a <= 5.8e-209)
		tmp = (y / t) * z;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(-1.0 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.36e-49], t$95$1, If[LessEqual[a, 5.8e-209], N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y - -1 \cdot x\\
\mathbf{if}\;a \leq -1.36 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{-209}:\\
\;\;\;\;\frac{y}{t} \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.36000000000000006e-49 or 5.80000000000000052e-209 < a

    1. Initial program 77.6%

      \[\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-*.f6465.8

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

      \[\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-/.f6467.6

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot x} \]
    10. Step-by-step derivation
      1. lower-*.f6460.9

        \[\leadsto y - -1 \cdot \color{blue}{x} \]
    11. Applied rewrites60.9%

      \[\leadsto y - \color{blue}{-1 \cdot x} \]

    if -1.36000000000000006e-49 < a < 5.80000000000000052e-209

    1. Initial program 77.6%

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

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

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

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

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

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

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
      6. lower-*.f6457.2

        \[\leadsto x + -1 \cdot \frac{a \cdot y - y \cdot z}{t} \]
    4. Applied rewrites57.2%

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

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

        \[\leadsto \frac{y \cdot z}{t} \]
      2. lower-*.f6418.2

        \[\leadsto \frac{y \cdot z}{t} \]
    7. Applied rewrites18.2%

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

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

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

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

        \[\leadsto \frac{y}{t} \cdot z \]
      5. lower-*.f6419.5

        \[\leadsto \frac{y}{t} \cdot z \]
    9. Applied rewrites19.5%

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

Alternative 13: 58.7% accurate, 2.7× speedup?

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

\\
y - -1 \cdot x
\end{array}
Derivation
  1. Initial program 77.6%

    \[\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-*.f6465.8

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

    \[\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-/.f6467.6

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

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

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

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

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

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

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

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

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

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

    \[\leadsto y - \color{blue}{-1 \cdot x} \]
  10. Step-by-step derivation
    1. lower-*.f6460.9

      \[\leadsto y - -1 \cdot \color{blue}{x} \]
  11. Applied rewrites60.9%

    \[\leadsto y - \color{blue}{-1 \cdot x} \]
  12. Add Preprocessing

Alternative 14: 45.4% accurate, 2.9× speedup?

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

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

    \[\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-*.f6465.8

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

    \[\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-/.f6467.6

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y - \left(y - \color{blue}{x}\right) \]
  11. Applied rewrites45.4%

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

Reproduce

?
herbie shell --seed 2025156 
(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))))