Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B

Percentage Accurate: 99.8% → 99.9%
Time: 3.2s
Alternatives: 13
Speedup: 1.2×

Specification

?
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
(FPCore (x y z t)
  :precision binary64
  (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t):
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t)
	return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0))
end
function tmp = code(x, y, z, t)
	tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
(FPCore (x y z t)
  :precision binary64
  (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t):
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t)
	return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0))
end
function tmp = code(x, y, z, t)
	tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5

Alternative 1: 99.9% accurate, 1.2× speedup?

\[\mathsf{fma}\left(y, 5, \mathsf{fma}\left(2, z + y, t\right) \cdot x\right) \]
(FPCore (x y z t)
  :precision binary64
  (fma y 5.0 (* (fma 2.0 (+ z y) t) x)))
double code(double x, double y, double z, double t) {
	return fma(y, 5.0, (fma(2.0, (z + y), t) * x));
}
function code(x, y, z, t)
	return fma(y, 5.0, Float64(fma(2.0, Float64(z + y), t) * x))
end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(N[(2.0 * N[(z + y), $MachinePrecision] + t), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(y, 5, \mathsf{fma}\left(2, z + y, t\right) \cdot x\right)
Derivation
  1. Initial program 99.8%

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

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

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

      \[\leadsto \color{blue}{y \cdot 5} + x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \]
    4. lower-fma.f6499.9%

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

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

      \[\leadsto \mathsf{fma}\left(y, 5, \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x}\right) \]
    7. lower-*.f6499.9%

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

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

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

      \[\leadsto \mathsf{fma}\left(y, 5, \left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t\right) \cdot x\right) \]
    11. associate-+l+N/A

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

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

      \[\leadsto \mathsf{fma}\left(y, 5, \left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right) \cdot x\right) \]
    14. count-2N/A

      \[\leadsto \mathsf{fma}\left(y, 5, \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \cdot x\right) \]
    15. lower-fma.f6499.9%

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

      \[\leadsto \mathsf{fma}\left(y, 5, \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \cdot x\right) \]
    17. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(y, 5, \mathsf{fma}\left(2, \color{blue}{z + y}, t\right) \cdot x\right) \]
    18. lower-+.f6499.9%

      \[\leadsto \mathsf{fma}\left(y, 5, \mathsf{fma}\left(2, \color{blue}{z + y}, t\right) \cdot x\right) \]
  3. Applied rewrites99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, \mathsf{fma}\left(2, z + y, t\right) \cdot x\right)} \]
  4. Add Preprocessing

Alternative 2: 91.4% accurate, 0.9× speedup?

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

\mathbf{elif}\;y \leq 2.6 \cdot 10^{-51}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + z\right) + z, x, 5 \cdot y\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.8000000000000004e46 or 2.6e-51 < y

    1. Initial program 99.8%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Taylor expanded in z around 0

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

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

        \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
      3. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
      4. lower-*.f6474.9%

        \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
    4. Applied rewrites74.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right)} \]

    if -5.8000000000000004e46 < y < 2.6e-51

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
      4. lower-fma.f6499.8%

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
      8. associate-+l+N/A

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

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

        \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
      11. count-2N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
      12. lower-fma.f6499.8%

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
      15. lower-+.f6499.8%

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
      18. lower-*.f6499.8%

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
    3. Applied rewrites99.8%

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{t + 2 \cdot z}, x, 5 \cdot y\right) \]
        3. count-2-revN/A

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(t + z\right) + z}, x, 5 \cdot y\right) \]
        6. lower-+.f6484.3%

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(t + z\right)} + z, x, 5 \cdot y\right) \]
      3. Applied rewrites84.3%

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

    Alternative 3: 90.5% accurate, 0.9× speedup?

    \[\begin{array}{l} t_1 := \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, 5\right), x \cdot t\right)\\ \mathbf{if}\;y \leq -5.8 \cdot 10^{+46}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-51}:\\ \;\;\;\;\mathsf{fma}\left(\left(t + z\right) + z, x, 5 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
    (FPCore (x y z t)
      :precision binary64
      (let* ((t_1 (fma y (fma x 2.0 5.0) (* x t))))
      (if (<= y -5.8e+46)
        t_1
        (if (<= y 2.6e-51) (fma (+ (+ t z) z) x (* 5.0 y)) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = fma(y, fma(x, 2.0, 5.0), (x * t));
    	double tmp;
    	if (y <= -5.8e+46) {
    		tmp = t_1;
    	} else if (y <= 2.6e-51) {
    		tmp = fma(((t + z) + z), x, (5.0 * y));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = fma(y, fma(x, 2.0, 5.0), Float64(x * t))
    	tmp = 0.0
    	if (y <= -5.8e+46)
    		tmp = t_1;
    	elseif (y <= 2.6e-51)
    		tmp = fma(Float64(Float64(t + z) + z), x, Float64(5.0 * y));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e+46], t$95$1, If[LessEqual[y, 2.6e-51], N[(N[(N[(t + z), $MachinePrecision] + z), $MachinePrecision] * x + N[(5.0 * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, 5\right), x \cdot t\right)\\
    \mathbf{if}\;y \leq -5.8 \cdot 10^{+46}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y \leq 2.6 \cdot 10^{-51}:\\
    \;\;\;\;\mathsf{fma}\left(\left(t + z\right) + z, x, 5 \cdot y\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < -5.8000000000000004e46 or 2.6e-51 < y

      1. Initial program 99.8%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Taylor expanded in z around 0

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

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

          \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
        3. lower-+.f64N/A

          \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
        4. lower-*.f6474.9%

          \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
      4. Applied rewrites74.9%

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

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

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

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

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

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

          \[\leadsto y \cdot 5 + x \cdot \left(2 \cdot y + \color{blue}{t}\right) \]
        7. distribute-lft-inN/A

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

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

          \[\leadsto y \cdot 5 + \left(x \cdot \left(2 \cdot y\right) + t \cdot \color{blue}{x}\right) \]
        10. associate-+r+N/A

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

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

          \[\leadsto \left(x \cdot \left(2 \cdot y\right) + y \cdot 5\right) + t \cdot x \]
        13. *-commutativeN/A

          \[\leadsto \left(x \cdot \left(2 \cdot y\right) + 5 \cdot y\right) + t \cdot x \]
        14. lift-*.f64N/A

          \[\leadsto \left(x \cdot \left(2 \cdot y\right) + 5 \cdot y\right) + t \cdot x \]
        15. associate-*r*N/A

          \[\leadsto \left(\left(x \cdot 2\right) \cdot y + 5 \cdot y\right) + t \cdot x \]
        16. distribute-rgt-outN/A

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

          \[\leadsto \mathsf{fma}\left(y, \color{blue}{x \cdot 2 + 5}, t \cdot x\right) \]
        18. lower-fma.f6473.9%

          \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, \color{blue}{2}, 5\right), t \cdot x\right) \]
        19. lift-*.f64N/A

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

          \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, \color{blue}{5}\right), x \cdot t\right) \]
        21. lower-*.f6473.9%

          \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, \color{blue}{5}\right), x \cdot t\right) \]
      6. Applied rewrites73.9%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(x, 2, 5\right)}, x \cdot t\right) \]

      if -5.8000000000000004e46 < y < 2.6e-51

      1. Initial program 99.8%

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

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

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

          \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
        4. lower-fma.f6499.8%

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

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

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

          \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
        8. associate-+l+N/A

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

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

          \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
        11. count-2N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
        12. lower-fma.f6499.8%

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
        15. lower-+.f6499.8%

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
        18. lower-*.f6499.8%

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
      3. Applied rewrites99.8%

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{t + 2 \cdot z}, x, 5 \cdot y\right) \]
          3. count-2-revN/A

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(t + z\right) + z}, x, 5 \cdot y\right) \]
          6. lower-+.f6484.3%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(t + z\right)} + z, x, 5 \cdot y\right) \]
        3. Applied rewrites84.3%

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

      Alternative 4: 90.5% accurate, 0.9× speedup?

      \[\begin{array}{l} t_1 := \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, 5\right), x \cdot t\right)\\ \mathbf{if}\;y \leq -5.8 \cdot 10^{+46}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-51}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(2, z, t\right), x, 5 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
      (FPCore (x y z t)
        :precision binary64
        (let* ((t_1 (fma y (fma x 2.0 5.0) (* x t))))
        (if (<= y -5.8e+46)
          t_1
          (if (<= y 2.6e-51) (fma (fma 2.0 z t) x (* 5.0 y)) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = fma(y, fma(x, 2.0, 5.0), (x * t));
      	double tmp;
      	if (y <= -5.8e+46) {
      		tmp = t_1;
      	} else if (y <= 2.6e-51) {
      		tmp = fma(fma(2.0, z, t), x, (5.0 * y));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = fma(y, fma(x, 2.0, 5.0), Float64(x * t))
      	tmp = 0.0
      	if (y <= -5.8e+46)
      		tmp = t_1;
      	elseif (y <= 2.6e-51)
      		tmp = fma(fma(2.0, z, t), x, Float64(5.0 * y));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e+46], t$95$1, If[LessEqual[y, 2.6e-51], N[(N[(2.0 * z + t), $MachinePrecision] * x + N[(5.0 * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      t_1 := \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, 5\right), x \cdot t\right)\\
      \mathbf{if}\;y \leq -5.8 \cdot 10^{+46}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 2.6 \cdot 10^{-51}:\\
      \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(2, z, t\right), x, 5 \cdot y\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -5.8000000000000004e46 or 2.6e-51 < y

        1. Initial program 99.8%

          \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
        2. Taylor expanded in z around 0

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

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

            \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
          3. lower-+.f64N/A

            \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
          4. lower-*.f6474.9%

            \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
        4. Applied rewrites74.9%

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

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

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

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

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

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

            \[\leadsto y \cdot 5 + x \cdot \left(2 \cdot y + \color{blue}{t}\right) \]
          7. distribute-lft-inN/A

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

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

            \[\leadsto y \cdot 5 + \left(x \cdot \left(2 \cdot y\right) + t \cdot \color{blue}{x}\right) \]
          10. associate-+r+N/A

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

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

            \[\leadsto \left(x \cdot \left(2 \cdot y\right) + y \cdot 5\right) + t \cdot x \]
          13. *-commutativeN/A

            \[\leadsto \left(x \cdot \left(2 \cdot y\right) + 5 \cdot y\right) + t \cdot x \]
          14. lift-*.f64N/A

            \[\leadsto \left(x \cdot \left(2 \cdot y\right) + 5 \cdot y\right) + t \cdot x \]
          15. associate-*r*N/A

            \[\leadsto \left(\left(x \cdot 2\right) \cdot y + 5 \cdot y\right) + t \cdot x \]
          16. distribute-rgt-outN/A

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

            \[\leadsto \mathsf{fma}\left(y, \color{blue}{x \cdot 2 + 5}, t \cdot x\right) \]
          18. lower-fma.f6473.9%

            \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, \color{blue}{2}, 5\right), t \cdot x\right) \]
          19. lift-*.f64N/A

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

            \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, \color{blue}{5}\right), x \cdot t\right) \]
          21. lower-*.f6473.9%

            \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, \color{blue}{5}\right), x \cdot t\right) \]
        6. Applied rewrites73.9%

          \[\leadsto \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(x, 2, 5\right)}, x \cdot t\right) \]

        if -5.8000000000000004e46 < y < 2.6e-51

        1. Initial program 99.8%

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

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

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

            \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
          4. lower-fma.f6499.8%

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
          8. associate-+l+N/A

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

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

            \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
          11. count-2N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
          12. lower-fma.f6499.8%

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
          15. lower-+.f6499.8%

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          18. lower-*.f6499.8%

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
        3. Applied rewrites99.8%

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

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

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

        Alternative 5: 83.5% accurate, 0.9× speedup?

        \[\begin{array}{l} t_1 := \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, 5\right), x \cdot t\right)\\ \mathbf{if}\;y \leq -5.5 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-114}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
        (FPCore (x y z t)
          :precision binary64
          (let* ((t_1 (fma y (fma x 2.0 5.0) (* x t))))
          (if (<= y -5.5e-28)
            t_1
            (if (<= y 5e-114) (* x (+ t (* 2.0 z))) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = fma(y, fma(x, 2.0, 5.0), (x * t));
        	double tmp;
        	if (y <= -5.5e-28) {
        		tmp = t_1;
        	} else if (y <= 5e-114) {
        		tmp = x * (t + (2.0 * z));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = fma(y, fma(x, 2.0, 5.0), Float64(x * t))
        	tmp = 0.0
        	if (y <= -5.5e-28)
        		tmp = t_1;
        	elseif (y <= 5e-114)
        		tmp = Float64(x * Float64(t + Float64(2.0 * z)));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e-28], t$95$1, If[LessEqual[y, 5e-114], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        t_1 := \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, 5\right), x \cdot t\right)\\
        \mathbf{if}\;y \leq -5.5 \cdot 10^{-28}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;y \leq 5 \cdot 10^{-114}:\\
        \;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -5.4999999999999997e-28 or 4.9999999999999999e-114 < y

          1. Initial program 99.8%

            \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
          2. Taylor expanded in z around 0

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

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

              \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
            3. lower-+.f64N/A

              \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
            4. lower-*.f6474.9%

              \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
          4. Applied rewrites74.9%

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

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

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

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

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

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

              \[\leadsto y \cdot 5 + x \cdot \left(2 \cdot y + \color{blue}{t}\right) \]
            7. distribute-lft-inN/A

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

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

              \[\leadsto y \cdot 5 + \left(x \cdot \left(2 \cdot y\right) + t \cdot \color{blue}{x}\right) \]
            10. associate-+r+N/A

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

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

              \[\leadsto \left(x \cdot \left(2 \cdot y\right) + y \cdot 5\right) + t \cdot x \]
            13. *-commutativeN/A

              \[\leadsto \left(x \cdot \left(2 \cdot y\right) + 5 \cdot y\right) + t \cdot x \]
            14. lift-*.f64N/A

              \[\leadsto \left(x \cdot \left(2 \cdot y\right) + 5 \cdot y\right) + t \cdot x \]
            15. associate-*r*N/A

              \[\leadsto \left(\left(x \cdot 2\right) \cdot y + 5 \cdot y\right) + t \cdot x \]
            16. distribute-rgt-outN/A

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

              \[\leadsto \mathsf{fma}\left(y, \color{blue}{x \cdot 2 + 5}, t \cdot x\right) \]
            18. lower-fma.f6473.9%

              \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, \color{blue}{2}, 5\right), t \cdot x\right) \]
            19. lift-*.f64N/A

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

              \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, \color{blue}{5}\right), x \cdot t\right) \]
            21. lower-*.f6473.9%

              \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, \color{blue}{5}\right), x \cdot t\right) \]
          6. Applied rewrites73.9%

            \[\leadsto \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(x, 2, 5\right)}, x \cdot t\right) \]

          if -5.4999999999999997e-28 < y < 4.9999999999999999e-114

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.8%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            8. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            11. count-2N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. lower-fma.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
            15. lower-+.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
            18. lower-*.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          3. Applied rewrites99.8%

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

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

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(z + y\right)} + t, x, 5 \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(y + z\right)} + t, x, 5 \cdot y\right) \]
            4. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + y\right) + z\right)} + t, x, 5 \cdot y\right) \]
            6. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + \left(y + z\right)\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            9. associate-+r+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + y\right) + z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            10. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            12. lower-+.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, y, z\right) + \color{blue}{\left(z + t\right)}, x, 5 \cdot y\right) \]
          5. Applied rewrites99.8%

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

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

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

              \[\leadsto x \cdot \left(t + \color{blue}{2 \cdot z}\right) \]
            3. lower-*.f6455.7%

              \[\leadsto x \cdot \left(t + 2 \cdot \color{blue}{z}\right) \]
          8. Applied rewrites55.7%

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

        Alternative 6: 79.2% accurate, 1.0× speedup?

        \[\begin{array}{l} t_1 := \mathsf{fma}\left(y, 5, \left(y + y\right) \cdot x\right)\\ \mathbf{if}\;y \leq -8.2 \cdot 10^{+30}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.58 \cdot 10^{+32}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
        (FPCore (x y z t)
          :precision binary64
          (let* ((t_1 (fma y 5.0 (* (+ y y) x))))
          (if (<= y -8.2e+30)
            t_1
            (if (<= y 1.58e+32) (* x (+ t (* 2.0 z))) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = fma(y, 5.0, ((y + y) * x));
        	double tmp;
        	if (y <= -8.2e+30) {
        		tmp = t_1;
        	} else if (y <= 1.58e+32) {
        		tmp = x * (t + (2.0 * z));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = fma(y, 5.0, Float64(Float64(y + y) * x))
        	tmp = 0.0
        	if (y <= -8.2e+30)
        		tmp = t_1;
        	elseif (y <= 1.58e+32)
        		tmp = Float64(x * Float64(t + Float64(2.0 * z)));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * 5.0 + N[(N[(y + y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.2e+30], t$95$1, If[LessEqual[y, 1.58e+32], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        t_1 := \mathsf{fma}\left(y, 5, \left(y + y\right) \cdot x\right)\\
        \mathbf{if}\;y \leq -8.2 \cdot 10^{+30}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;y \leq 1.58 \cdot 10^{+32}:\\
        \;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -8.2000000000000001e30 or 1.5800000000000001e32 < y

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{y \cdot 5} + x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \]
            4. lower-fma.f6499.9%

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

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

              \[\leadsto \mathsf{fma}\left(y, 5, \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x}\right) \]
            7. lower-*.f6499.9%

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

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

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

              \[\leadsto \mathsf{fma}\left(y, 5, \left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t\right) \cdot x\right) \]
            11. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(y, 5, \left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right) \cdot x\right) \]
            14. count-2N/A

              \[\leadsto \mathsf{fma}\left(y, 5, \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \cdot x\right) \]
            15. lower-fma.f6499.9%

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

              \[\leadsto \mathsf{fma}\left(y, 5, \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \cdot x\right) \]
            17. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(y, 5, \mathsf{fma}\left(2, \color{blue}{z + y}, t\right) \cdot x\right) \]
            18. lower-+.f6499.9%

              \[\leadsto \mathsf{fma}\left(y, 5, \mathsf{fma}\left(2, \color{blue}{z + y}, t\right) \cdot x\right) \]
          3. Applied rewrites99.9%

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

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

              \[\leadsto \mathsf{fma}\left(y, 5, 2 \cdot \color{blue}{\left(x \cdot y\right)}\right) \]
            2. lower-*.f6449.2%

              \[\leadsto \mathsf{fma}\left(y, 5, 2 \cdot \left(x \cdot \color{blue}{y}\right)\right) \]
          6. Applied rewrites49.2%

            \[\leadsto \mathsf{fma}\left(y, 5, \color{blue}{2 \cdot \left(x \cdot y\right)}\right) \]
          7. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(y, 5, 2 \cdot \color{blue}{\left(x \cdot y\right)}\right) \]
            2. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(y, 5, 2 \cdot \left(x \cdot \color{blue}{y}\right)\right) \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(y, 5, 2 \cdot \left(y \cdot \color{blue}{x}\right)\right) \]
            4. associate-*r*N/A

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

              \[\leadsto \mathsf{fma}\left(y, 5, \left(2 \cdot y\right) \cdot \color{blue}{x}\right) \]
            6. count-2-revN/A

              \[\leadsto \mathsf{fma}\left(y, 5, \left(y + y\right) \cdot x\right) \]
            7. lower-+.f6449.2%

              \[\leadsto \mathsf{fma}\left(y, 5, \left(y + y\right) \cdot x\right) \]
          8. Applied rewrites49.2%

            \[\leadsto \mathsf{fma}\left(y, 5, \left(y + y\right) \cdot \color{blue}{x}\right) \]

          if -8.2000000000000001e30 < y < 1.5800000000000001e32

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.8%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            8. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            11. count-2N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. lower-fma.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
            15. lower-+.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
            18. lower-*.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          3. Applied rewrites99.8%

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

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

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(z + y\right)} + t, x, 5 \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(y + z\right)} + t, x, 5 \cdot y\right) \]
            4. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + y\right) + z\right)} + t, x, 5 \cdot y\right) \]
            6. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + \left(y + z\right)\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            9. associate-+r+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + y\right) + z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            10. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            12. lower-+.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, y, z\right) + \color{blue}{\left(z + t\right)}, x, 5 \cdot y\right) \]
          5. Applied rewrites99.8%

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

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

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

              \[\leadsto x \cdot \left(t + \color{blue}{2 \cdot z}\right) \]
            3. lower-*.f6455.7%

              \[\leadsto x \cdot \left(t + 2 \cdot \color{blue}{z}\right) \]
          8. Applied rewrites55.7%

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

        Alternative 7: 79.2% accurate, 1.2× speedup?

        \[\begin{array}{l} t_1 := \mathsf{fma}\left(2, x, 5\right) \cdot y\\ \mathbf{if}\;y \leq -8.2 \cdot 10^{+30}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.58 \cdot 10^{+32}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
        (FPCore (x y z t)
          :precision binary64
          (let* ((t_1 (* (fma 2.0 x 5.0) y)))
          (if (<= y -8.2e+30)
            t_1
            (if (<= y 1.58e+32) (* x (+ t (* 2.0 z))) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = fma(2.0, x, 5.0) * y;
        	double tmp;
        	if (y <= -8.2e+30) {
        		tmp = t_1;
        	} else if (y <= 1.58e+32) {
        		tmp = x * (t + (2.0 * z));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = Float64(fma(2.0, x, 5.0) * y)
        	tmp = 0.0
        	if (y <= -8.2e+30)
        		tmp = t_1;
        	elseif (y <= 1.58e+32)
        		tmp = Float64(x * Float64(t + Float64(2.0 * z)));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 * x + 5.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -8.2e+30], t$95$1, If[LessEqual[y, 1.58e+32], N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        t_1 := \mathsf{fma}\left(2, x, 5\right) \cdot y\\
        \mathbf{if}\;y \leq -8.2 \cdot 10^{+30}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;y \leq 1.58 \cdot 10^{+32}:\\
        \;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -8.2000000000000001e30 or 1.5800000000000001e32 < y

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.8%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            8. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            11. count-2N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. lower-fma.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
            15. lower-+.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
            18. lower-*.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          3. Applied rewrites99.8%

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

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

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(z + y\right)} + t, x, 5 \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(y + z\right)} + t, x, 5 \cdot y\right) \]
            4. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + y\right) + z\right)} + t, x, 5 \cdot y\right) \]
            6. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + \left(y + z\right)\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            9. associate-+r+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + y\right) + z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            10. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            12. lower-+.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, y, z\right) + \color{blue}{\left(z + t\right)}, x, 5 \cdot y\right) \]
          5. Applied rewrites99.8%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right) + \left(z + t\right)}, x, 5 \cdot y\right) \]
          6. Taylor expanded in y around inf

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

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

              \[\leadsto y \cdot \left(5 + \color{blue}{2 \cdot x}\right) \]
            3. lower-*.f6449.2%

              \[\leadsto y \cdot \left(5 + 2 \cdot \color{blue}{x}\right) \]
          8. Applied rewrites49.2%

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

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

              \[\leadsto \left(5 + 2 \cdot x\right) \cdot \color{blue}{y} \]
            3. lower-*.f6449.2%

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

              \[\leadsto \left(5 + 2 \cdot x\right) \cdot y \]
            5. +-commutativeN/A

              \[\leadsto \left(2 \cdot x + 5\right) \cdot y \]
            6. lift-*.f64N/A

              \[\leadsto \left(2 \cdot x + 5\right) \cdot y \]
            7. lower-fma.f6449.2%

              \[\leadsto \mathsf{fma}\left(2, x, 5\right) \cdot y \]
          10. Applied rewrites49.2%

            \[\leadsto \mathsf{fma}\left(2, x, 5\right) \cdot \color{blue}{y} \]

          if -8.2000000000000001e30 < y < 1.5800000000000001e32

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.8%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            8. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            11. count-2N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. lower-fma.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
            15. lower-+.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
            18. lower-*.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          3. Applied rewrites99.8%

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

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

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(z + y\right)} + t, x, 5 \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(y + z\right)} + t, x, 5 \cdot y\right) \]
            4. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + y\right) + z\right)} + t, x, 5 \cdot y\right) \]
            6. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + \left(y + z\right)\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            9. associate-+r+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + y\right) + z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            10. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            12. lower-+.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, y, z\right) + \color{blue}{\left(z + t\right)}, x, 5 \cdot y\right) \]
          5. Applied rewrites99.8%

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

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

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

              \[\leadsto x \cdot \left(t + \color{blue}{2 \cdot z}\right) \]
            3. lower-*.f6455.7%

              \[\leadsto x \cdot \left(t + 2 \cdot \color{blue}{z}\right) \]
          8. Applied rewrites55.7%

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

        Alternative 8: 74.1% accurate, 1.2× speedup?

        \[\begin{array}{l} t_1 := x \cdot \left(t + 2 \cdot y\right)\\ \mathbf{if}\;x \leq -2100000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 12.5:\\ \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
        (FPCore (x y z t)
          :precision binary64
          (let* ((t_1 (* x (+ t (* 2.0 y)))))
          (if (<= x -2100000000.0)
            t_1
            (if (<= x 12.5) (fma y 5.0 (* x t)) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = x * (t + (2.0 * y));
        	double tmp;
        	if (x <= -2100000000.0) {
        		tmp = t_1;
        	} else if (x <= 12.5) {
        		tmp = fma(y, 5.0, (x * t));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = Float64(x * Float64(t + Float64(2.0 * y)))
        	tmp = 0.0
        	if (x <= -2100000000.0)
        		tmp = t_1;
        	elseif (x <= 12.5)
        		tmp = fma(y, 5.0, Float64(x * t));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2100000000.0], t$95$1, If[LessEqual[x, 12.5], N[(y * 5.0 + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        t_1 := x \cdot \left(t + 2 \cdot y\right)\\
        \mathbf{if}\;x \leq -2100000000:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \leq 12.5:\\
        \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -2.1e9 or 12.5 < x

          1. Initial program 99.8%

            \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
          2. Taylor expanded in z around 0

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

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

              \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
            3. lower-+.f64N/A

              \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
            4. lower-*.f6474.9%

              \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right) \]
          4. Applied rewrites74.9%

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

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

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

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

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

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

              \[\leadsto y \cdot 5 + x \cdot \left(2 \cdot y + \color{blue}{t}\right) \]
            7. distribute-lft-inN/A

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

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

              \[\leadsto y \cdot 5 + \left(x \cdot \left(2 \cdot y\right) + t \cdot \color{blue}{x}\right) \]
            10. associate-+r+N/A

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

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

              \[\leadsto \left(x \cdot \left(2 \cdot y\right) + y \cdot 5\right) + t \cdot x \]
            13. *-commutativeN/A

              \[\leadsto \left(x \cdot \left(2 \cdot y\right) + 5 \cdot y\right) + t \cdot x \]
            14. lift-*.f64N/A

              \[\leadsto \left(x \cdot \left(2 \cdot y\right) + 5 \cdot y\right) + t \cdot x \]
            15. associate-*r*N/A

              \[\leadsto \left(\left(x \cdot 2\right) \cdot y + 5 \cdot y\right) + t \cdot x \]
            16. distribute-rgt-outN/A

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

              \[\leadsto \mathsf{fma}\left(y, \color{blue}{x \cdot 2 + 5}, t \cdot x\right) \]
            18. lower-fma.f6473.9%

              \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, \color{blue}{2}, 5\right), t \cdot x\right) \]
            19. lift-*.f64N/A

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

              \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, \color{blue}{5}\right), x \cdot t\right) \]
            21. lower-*.f6473.9%

              \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(x, 2, \color{blue}{5}\right), x \cdot t\right) \]
          6. Applied rewrites73.9%

            \[\leadsto \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(x, 2, 5\right)}, x \cdot t\right) \]
          7. Taylor expanded in x around inf

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

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

              \[\leadsto x \cdot \left(t + 2 \cdot \color{blue}{y}\right) \]
            3. lower-*.f6446.3%

              \[\leadsto x \cdot \left(t + 2 \cdot y\right) \]
          9. Applied rewrites46.3%

            \[\leadsto x \cdot \color{blue}{\left(t + 2 \cdot y\right)} \]

          if -2.1e9 < x < 12.5

          1. Initial program 99.8%

            \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
          2. Taylor expanded in t around inf

            \[\leadsto \color{blue}{t \cdot x} + y \cdot 5 \]
          3. Step-by-step derivation
            1. lower-*.f6458.5%

              \[\leadsto t \cdot \color{blue}{x} + y \cdot 5 \]
          4. Applied rewrites58.5%

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

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

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

              \[\leadsto \color{blue}{y \cdot 5} + t \cdot x \]
            4. lower-fma.f6458.5%

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

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

              \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{t}\right) \]
            7. lower-*.f6458.5%

              \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{t}\right) \]
          6. Applied rewrites58.5%

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

        Alternative 9: 66.5% accurate, 1.2× speedup?

        \[\begin{array}{l} t_1 := \mathsf{fma}\left(y, 5, x \cdot t\right)\\ \mathbf{if}\;t \leq -2.5 \cdot 10^{-102}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4200000:\\ \;\;\;\;\mathsf{fma}\left(2, x, 5\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
        (FPCore (x y z t)
          :precision binary64
          (let* ((t_1 (fma y 5.0 (* x t))))
          (if (<= t -2.5e-102)
            t_1
            (if (<= t 4200000.0) (* (fma 2.0 x 5.0) y) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = fma(y, 5.0, (x * t));
        	double tmp;
        	if (t <= -2.5e-102) {
        		tmp = t_1;
        	} else if (t <= 4200000.0) {
        		tmp = fma(2.0, x, 5.0) * y;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = fma(y, 5.0, Float64(x * t))
        	tmp = 0.0
        	if (t <= -2.5e-102)
        		tmp = t_1;
        	elseif (t <= 4200000.0)
        		tmp = Float64(fma(2.0, x, 5.0) * y);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * 5.0 + N[(x * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.5e-102], t$95$1, If[LessEqual[t, 4200000.0], N[(N[(2.0 * x + 5.0), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        t_1 := \mathsf{fma}\left(y, 5, x \cdot t\right)\\
        \mathbf{if}\;t \leq -2.5 \cdot 10^{-102}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t \leq 4200000:\\
        \;\;\;\;\mathsf{fma}\left(2, x, 5\right) \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if t < -2.5000000000000001e-102 or 4.2e6 < t

          1. Initial program 99.8%

            \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
          2. Taylor expanded in t around inf

            \[\leadsto \color{blue}{t \cdot x} + y \cdot 5 \]
          3. Step-by-step derivation
            1. lower-*.f6458.5%

              \[\leadsto t \cdot \color{blue}{x} + y \cdot 5 \]
          4. Applied rewrites58.5%

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

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

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

              \[\leadsto \color{blue}{y \cdot 5} + t \cdot x \]
            4. lower-fma.f6458.5%

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

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

              \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{t}\right) \]
            7. lower-*.f6458.5%

              \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{t}\right) \]
          6. Applied rewrites58.5%

            \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, x \cdot t\right)} \]

          if -2.5000000000000001e-102 < t < 4.2e6

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.8%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            8. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            11. count-2N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. lower-fma.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
            15. lower-+.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
            18. lower-*.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          3. Applied rewrites99.8%

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

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

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(z + y\right)} + t, x, 5 \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(y + z\right)} + t, x, 5 \cdot y\right) \]
            4. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + y\right) + z\right)} + t, x, 5 \cdot y\right) \]
            6. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + \left(y + z\right)\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            9. associate-+r+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + y\right) + z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            10. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            12. lower-+.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, y, z\right) + \color{blue}{\left(z + t\right)}, x, 5 \cdot y\right) \]
          5. Applied rewrites99.8%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right) + \left(z + t\right)}, x, 5 \cdot y\right) \]
          6. Taylor expanded in y around inf

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

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

              \[\leadsto y \cdot \left(5 + \color{blue}{2 \cdot x}\right) \]
            3. lower-*.f6449.2%

              \[\leadsto y \cdot \left(5 + 2 \cdot \color{blue}{x}\right) \]
          8. Applied rewrites49.2%

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

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

              \[\leadsto \left(5 + 2 \cdot x\right) \cdot \color{blue}{y} \]
            3. lower-*.f6449.2%

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

              \[\leadsto \left(5 + 2 \cdot x\right) \cdot y \]
            5. +-commutativeN/A

              \[\leadsto \left(2 \cdot x + 5\right) \cdot y \]
            6. lift-*.f64N/A

              \[\leadsto \left(2 \cdot x + 5\right) \cdot y \]
            7. lower-fma.f6449.2%

              \[\leadsto \mathsf{fma}\left(2, x, 5\right) \cdot y \]
          10. Applied rewrites49.2%

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

        Alternative 10: 59.5% accurate, 1.2× speedup?

        \[\begin{array}{l} t_1 := \mathsf{fma}\left(2, x, 5\right) \cdot y\\ \mathbf{if}\;y \leq -5.5 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-114}:\\ \;\;\;\;\left(z + z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
        (FPCore (x y z t)
          :precision binary64
          (let* ((t_1 (* (fma 2.0 x 5.0) y)))
          (if (<= y -5.5e-28) t_1 (if (<= y 5e-114) (* (+ z z) x) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = fma(2.0, x, 5.0) * y;
        	double tmp;
        	if (y <= -5.5e-28) {
        		tmp = t_1;
        	} else if (y <= 5e-114) {
        		tmp = (z + z) * x;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = Float64(fma(2.0, x, 5.0) * y)
        	tmp = 0.0
        	if (y <= -5.5e-28)
        		tmp = t_1;
        	elseif (y <= 5e-114)
        		tmp = Float64(Float64(z + z) * x);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 * x + 5.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -5.5e-28], t$95$1, If[LessEqual[y, 5e-114], N[(N[(z + z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        t_1 := \mathsf{fma}\left(2, x, 5\right) \cdot y\\
        \mathbf{if}\;y \leq -5.5 \cdot 10^{-28}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;y \leq 5 \cdot 10^{-114}:\\
        \;\;\;\;\left(z + z\right) \cdot x\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -5.4999999999999997e-28 or 4.9999999999999999e-114 < y

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.8%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            8. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            11. count-2N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. lower-fma.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
            15. lower-+.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
            18. lower-*.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          3. Applied rewrites99.8%

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

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

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(z + y\right)} + t, x, 5 \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(y + z\right)} + t, x, 5 \cdot y\right) \]
            4. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + y\right) + z\right)} + t, x, 5 \cdot y\right) \]
            6. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + \left(y + z\right)\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            9. associate-+r+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + y\right) + z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            10. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            12. lower-+.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, y, z\right) + \color{blue}{\left(z + t\right)}, x, 5 \cdot y\right) \]
          5. Applied rewrites99.8%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right) + \left(z + t\right)}, x, 5 \cdot y\right) \]
          6. Taylor expanded in y around inf

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

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

              \[\leadsto y \cdot \left(5 + \color{blue}{2 \cdot x}\right) \]
            3. lower-*.f6449.2%

              \[\leadsto y \cdot \left(5 + 2 \cdot \color{blue}{x}\right) \]
          8. Applied rewrites49.2%

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

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

              \[\leadsto \left(5 + 2 \cdot x\right) \cdot \color{blue}{y} \]
            3. lower-*.f6449.2%

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

              \[\leadsto \left(5 + 2 \cdot x\right) \cdot y \]
            5. +-commutativeN/A

              \[\leadsto \left(2 \cdot x + 5\right) \cdot y \]
            6. lift-*.f64N/A

              \[\leadsto \left(2 \cdot x + 5\right) \cdot y \]
            7. lower-fma.f6449.2%

              \[\leadsto \mathsf{fma}\left(2, x, 5\right) \cdot y \]
          10. Applied rewrites49.2%

            \[\leadsto \mathsf{fma}\left(2, x, 5\right) \cdot \color{blue}{y} \]

          if -5.4999999999999997e-28 < y < 4.9999999999999999e-114

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.8%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            8. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            11. count-2N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. lower-fma.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
            15. lower-+.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
            18. lower-*.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          3. Applied rewrites99.8%

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

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

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(z + y\right)} + t, x, 5 \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(y + z\right)} + t, x, 5 \cdot y\right) \]
            4. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + y\right) + z\right)} + t, x, 5 \cdot y\right) \]
            6. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + \left(y + z\right)\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            9. associate-+r+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + y\right) + z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            10. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            12. lower-+.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, y, z\right) + \color{blue}{\left(z + t\right)}, x, 5 \cdot y\right) \]
          5. Applied rewrites99.8%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right) + \left(z + t\right)}, x, 5 \cdot y\right) \]
          6. Taylor expanded in z around inf

            \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
          7. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto 2 \cdot \color{blue}{\left(x \cdot z\right)} \]
            2. lower-*.f6430.0%

              \[\leadsto 2 \cdot \left(x \cdot \color{blue}{z}\right) \]
          8. Applied rewrites30.0%

            \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
          9. Step-by-step derivation
            1. lift-*.f64N/A

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

              \[\leadsto 2 \cdot \left(x \cdot \color{blue}{z}\right) \]
            3. *-commutativeN/A

              \[\leadsto 2 \cdot \left(z \cdot \color{blue}{x}\right) \]
            4. associate-*r*N/A

              \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{x} \]
            5. count-2N/A

              \[\leadsto \left(z + z\right) \cdot x \]
            6. lift-+.f64N/A

              \[\leadsto \left(z + z\right) \cdot x \]
            7. lower-*.f6429.9%

              \[\leadsto \left(z + z\right) \cdot \color{blue}{x} \]
          10. Applied rewrites29.9%

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

        Alternative 11: 47.6% accurate, 1.4× speedup?

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

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.8%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            8. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            11. count-2N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. lower-fma.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
            15. lower-+.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
            18. lower-*.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          3. Applied rewrites99.8%

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

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

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(z + y\right)} + t, x, 5 \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(y + z\right)} + t, x, 5 \cdot y\right) \]
            4. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + y\right) + z\right)} + t, x, 5 \cdot y\right) \]
            6. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + \left(y + z\right)\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            9. associate-+r+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + y\right) + z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            10. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            12. lower-+.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, y, z\right) + \color{blue}{\left(z + t\right)}, x, 5 \cdot y\right) \]
          5. Applied rewrites99.8%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right) + \left(z + t\right)}, x, 5 \cdot y\right) \]
          6. Taylor expanded in z around inf

            \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
          7. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto 2 \cdot \color{blue}{\left(x \cdot z\right)} \]
            2. lower-*.f6430.0%

              \[\leadsto 2 \cdot \left(x \cdot \color{blue}{z}\right) \]
          8. Applied rewrites30.0%

            \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
          9. Step-by-step derivation
            1. lift-*.f64N/A

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

              \[\leadsto 2 \cdot \left(x \cdot \color{blue}{z}\right) \]
            3. *-commutativeN/A

              \[\leadsto 2 \cdot \left(z \cdot \color{blue}{x}\right) \]
            4. associate-*r*N/A

              \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{x} \]
            5. count-2N/A

              \[\leadsto \left(z + z\right) \cdot x \]
            6. lift-+.f64N/A

              \[\leadsto \left(z + z\right) \cdot x \]
            7. lower-*.f6429.9%

              \[\leadsto \left(z + z\right) \cdot \color{blue}{x} \]
          10. Applied rewrites29.9%

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

          if -1.7999999999999999e-23 < x < 4.6000000000000001e26

          1. Initial program 99.8%

            \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
          2. Taylor expanded in x around 0

            \[\leadsto \color{blue}{5 \cdot y} \]
          3. Step-by-step derivation
            1. lower-*.f6430.7%

              \[\leadsto 5 \cdot \color{blue}{y} \]
          4. Applied rewrites30.7%

            \[\leadsto \color{blue}{5 \cdot y} \]

          if 4.6000000000000001e26 < x

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.8%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            8. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            11. count-2N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. lower-fma.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
            15. lower-+.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
            18. lower-*.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          3. Applied rewrites99.8%

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

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

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(z + y\right)} + t, x, 5 \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(y + z\right)} + t, x, 5 \cdot y\right) \]
            4. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + y\right) + z\right)} + t, x, 5 \cdot y\right) \]
            6. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + \left(y + z\right)\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            9. associate-+r+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + y\right) + z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            10. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            12. lower-+.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, y, z\right) + \color{blue}{\left(z + t\right)}, x, 5 \cdot y\right) \]
          5. Applied rewrites99.8%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right) + \left(z + t\right)}, x, 5 \cdot y\right) \]
          6. Taylor expanded in y around inf

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

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

              \[\leadsto y \cdot \left(5 + \color{blue}{2 \cdot x}\right) \]
            3. lower-*.f6449.2%

              \[\leadsto y \cdot \left(5 + 2 \cdot \color{blue}{x}\right) \]
          8. Applied rewrites49.2%

            \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
          9. Taylor expanded in x around inf

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

              \[\leadsto 2 \cdot \left(x \cdot \color{blue}{y}\right) \]
            2. lower-*.f6420.9%

              \[\leadsto 2 \cdot \left(x \cdot y\right) \]
          11. Applied rewrites20.9%

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

        Alternative 12: 47.2% accurate, 1.4× speedup?

        \[\begin{array}{l} t_1 := \left(z + z\right) \cdot x\\ \mathbf{if}\;x \leq -1.8 \cdot 10^{-23}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+22}:\\ \;\;\;\;5 \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
        (FPCore (x y z t)
          :precision binary64
          (let* ((t_1 (* (+ z z) x)))
          (if (<= x -1.8e-23) t_1 (if (<= x 1.7e+22) (* 5.0 y) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = (z + z) * x;
        	double tmp;
        	if (x <= -1.8e-23) {
        		tmp = t_1;
        	} else if (x <= 1.7e+22) {
        		tmp = 5.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)
        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) :: t_1
            real(8) :: tmp
            t_1 = (z + z) * x
            if (x <= (-1.8d-23)) then
                tmp = t_1
            else if (x <= 1.7d+22) then
                tmp = 5.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 t_1 = (z + z) * x;
        	double tmp;
        	if (x <= -1.8e-23) {
        		tmp = t_1;
        	} else if (x <= 1.7e+22) {
        		tmp = 5.0 * y;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = (z + z) * x
        	tmp = 0
        	if x <= -1.8e-23:
        		tmp = t_1
        	elif x <= 1.7e+22:
        		tmp = 5.0 * y
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = Float64(Float64(z + z) * x)
        	tmp = 0.0
        	if (x <= -1.8e-23)
        		tmp = t_1;
        	elseif (x <= 1.7e+22)
        		tmp = Float64(5.0 * y);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = (z + z) * x;
        	tmp = 0.0;
        	if (x <= -1.8e-23)
        		tmp = t_1;
        	elseif (x <= 1.7e+22)
        		tmp = 5.0 * y;
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z + z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.8e-23], t$95$1, If[LessEqual[x, 1.7e+22], N[(5.0 * y), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        t_1 := \left(z + z\right) \cdot x\\
        \mathbf{if}\;x \leq -1.8 \cdot 10^{-23}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \leq 1.7 \cdot 10^{+22}:\\
        \;\;\;\;5 \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -1.7999999999999999e-23 or 1.7e22 < x

          1. Initial program 99.8%

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

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

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

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.8%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            8. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            11. count-2N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{2 \cdot \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. lower-fma.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, \color{blue}{z + y}, t\right), x, y \cdot 5\right) \]
            15. lower-+.f6499.8%

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
            18. lower-*.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, z + y, t\right), x, \color{blue}{5 \cdot y}\right) \]
          3. Applied rewrites99.8%

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

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

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(z + y\right)} + t, x, 5 \cdot y\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2 \cdot \color{blue}{\left(y + z\right)} + t, x, 5 \cdot y\right) \]
            4. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + y\right) + z\right)} + t, x, 5 \cdot y\right) \]
            6. associate-+l+N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + \left(y + z\right)\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            9. associate-+r+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + y\right) + z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            10. count-2-revN/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right)} + \left(z + t\right), x, 5 \cdot y\right) \]
            12. lower-+.f6499.8%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(2, y, z\right) + \color{blue}{\left(z + t\right)}, x, 5 \cdot y\right) \]
          5. Applied rewrites99.8%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(2, y, z\right) + \left(z + t\right)}, x, 5 \cdot y\right) \]
          6. Taylor expanded in z around inf

            \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
          7. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto 2 \cdot \color{blue}{\left(x \cdot z\right)} \]
            2. lower-*.f6430.0%

              \[\leadsto 2 \cdot \left(x \cdot \color{blue}{z}\right) \]
          8. Applied rewrites30.0%

            \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
          9. Step-by-step derivation
            1. lift-*.f64N/A

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

              \[\leadsto 2 \cdot \left(x \cdot \color{blue}{z}\right) \]
            3. *-commutativeN/A

              \[\leadsto 2 \cdot \left(z \cdot \color{blue}{x}\right) \]
            4. associate-*r*N/A

              \[\leadsto \left(2 \cdot z\right) \cdot \color{blue}{x} \]
            5. count-2N/A

              \[\leadsto \left(z + z\right) \cdot x \]
            6. lift-+.f64N/A

              \[\leadsto \left(z + z\right) \cdot x \]
            7. lower-*.f6429.9%

              \[\leadsto \left(z + z\right) \cdot \color{blue}{x} \]
          10. Applied rewrites29.9%

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

          if -1.7999999999999999e-23 < x < 1.7e22

          1. Initial program 99.8%

            \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
          2. Taylor expanded in x around 0

            \[\leadsto \color{blue}{5 \cdot y} \]
          3. Step-by-step derivation
            1. lower-*.f6430.7%

              \[\leadsto 5 \cdot \color{blue}{y} \]
          4. Applied rewrites30.7%

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

        Alternative 13: 30.7% accurate, 5.0× speedup?

        \[5 \cdot y \]
        (FPCore (x y z t)
          :precision binary64
          (* 5.0 y))
        double code(double x, double y, double z, double t) {
        	return 5.0 * y;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            code = 5.0d0 * y
        end function
        
        public static double code(double x, double y, double z, double t) {
        	return 5.0 * y;
        }
        
        def code(x, y, z, t):
        	return 5.0 * y
        
        function code(x, y, z, t)
        	return Float64(5.0 * y)
        end
        
        function tmp = code(x, y, z, t)
        	tmp = 5.0 * y;
        end
        
        code[x_, y_, z_, t_] := N[(5.0 * y), $MachinePrecision]
        
        5 \cdot y
        
        Derivation
        1. Initial program 99.8%

          \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
        2. Taylor expanded in x around 0

          \[\leadsto \color{blue}{5 \cdot y} \]
        3. Step-by-step derivation
          1. lower-*.f6430.7%

            \[\leadsto 5 \cdot \color{blue}{y} \]
        4. Applied rewrites30.7%

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

        Reproduce

        ?
        herbie shell --seed 2025212 
        (FPCore (x y z t)
          :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
          :precision binary64
          (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))