Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C

Percentage Accurate: 99.9% → 99.9%
Time: 4.5s
Alternatives: 18
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(x + \sin y\right) + z \cdot \cos y \end{array} \]
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
	return (x + sin(y)) + (z * cos(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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
	return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z):
	return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z)
	return Float64(Float64(x + sin(y)) + Float64(z * cos(y)))
end
function tmp = code(x, y, z)
	tmp = (x + sin(y)) + (z * cos(y));
end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 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.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x + \sin y\right) + z \cdot \cos y \end{array} \]
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
	return (x + sin(y)) + (z * cos(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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
	return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z):
	return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z)
	return Float64(Float64(x + sin(y)) + Float64(z * cos(y)))
end
function tmp = code(x, y, z)
	tmp = (x + sin(y)) + (z * cos(y));
end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\cos y, z, \sin y + x\right) \end{array} \]
(FPCore (x y z) :precision binary64 (fma (cos y) z (+ (sin y) x)))
double code(double x, double y, double z) {
	return fma(cos(y), z, (sin(y) + x));
}
function code(x, y, z)
	return fma(cos(y), z, Float64(sin(y) + x))
end
code[x_, y_, z_] := N[(N[Cos[y], $MachinePrecision] * z + N[(N[Sin[y], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\cos y, z, \sin y + x\right)
\end{array}
Derivation
  1. Initial program 99.9%

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

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

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

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

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

      \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
    6. +-commutativeN/A

      \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
    7. *-commutativeN/A

      \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
    8. lower-fma.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
    10. +-commutativeN/A

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

      \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
    12. lift-sin.f6499.9

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, z, \sin y + x\right)} \]
  4. Add Preprocessing

Alternative 2: 95.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(x, \frac{z \cdot \cos y}{x}, x\right)\\ \mathbf{if}\;x \leq -9.6 \cdot 10^{-14}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-20}:\\ \;\;\;\;\mathsf{fma}\left(\cos y, z, \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (fma x (/ (* z (cos y)) x) x)))
   (if (<= x -9.6e-14) t_0 (if (<= x 8.2e-20) (fma (cos y) z (sin y)) t_0))))
double code(double x, double y, double z) {
	double t_0 = fma(x, ((z * cos(y)) / x), x);
	double tmp;
	if (x <= -9.6e-14) {
		tmp = t_0;
	} else if (x <= 8.2e-20) {
		tmp = fma(cos(y), z, sin(y));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x, y, z)
	t_0 = fma(x, Float64(Float64(z * cos(y)) / x), x)
	tmp = 0.0
	if (x <= -9.6e-14)
		tmp = t_0;
	elseif (x <= 8.2e-20)
		tmp = fma(cos(y), z, sin(y));
	else
		tmp = t_0;
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[x, -9.6e-14], t$95$0, If[LessEqual[x, 8.2e-20], N[(N[Cos[y], $MachinePrecision] * z + N[Sin[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x, \frac{z \cdot \cos y}{x}, x\right)\\
\mathbf{if}\;x \leq -9.6 \cdot 10^{-14}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 8.2 \cdot 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(\cos y, z, \sin y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.599999999999999e-14 or 8.2000000000000002e-20 < x

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
      6. +-commutativeN/A

        \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
      7. *-commutativeN/A

        \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
      8. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
      10. +-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
      12. lift-sin.f6499.9

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
    5. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
      2. *-rgt-identityN/A

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
      5. div-add-revN/A

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

        \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
      9. lift-sin.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
      10. lift-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
      11. lift-cos.f6488.1

        \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
    6. Applied rewrites88.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
    7. Taylor expanded in z around inf

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y}{x}, x\right) \]
      3. lift-cos.f6471.5

        \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y}{x}, x\right) \]
    9. Applied rewrites71.5%

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

    if -9.599999999999999e-14 < x < 8.2000000000000002e-20

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{\sin y + z \cdot \cos y} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto z \cdot \cos y + \color{blue}{\sin y} \]
      2. *-commutativeN/A

        \[\leadsto \cos y \cdot z + \sin \color{blue}{y} \]
      3. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\cos y, \color{blue}{z}, \sin y\right) \]
      4. lift-cos.f64N/A

        \[\leadsto \mathsf{fma}\left(\cos y, z, \sin y\right) \]
      5. lift-sin.f6458.7

        \[\leadsto \mathsf{fma}\left(\cos y, z, \sin y\right) \]
    4. Applied rewrites58.7%

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

Alternative 3: 90.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(x, \frac{z \cdot \cos y}{x}, x\right)\\ \mathbf{if}\;z \leq -460000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-5}:\\ \;\;\;\;\left(\sin y + z\right) + x\\ \mathbf{elif}\;z \leq 8.6 \cdot 10^{+189}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\cos y, z, x + y\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (fma x (/ (* z (cos y)) x) x)))
   (if (<= z -460000000.0)
     t_0
     (if (<= z 7e-5)
       (+ (+ (sin y) z) x)
       (if (<= z 8.6e+189) t_0 (fma (cos y) z (+ x y)))))))
double code(double x, double y, double z) {
	double t_0 = fma(x, ((z * cos(y)) / x), x);
	double tmp;
	if (z <= -460000000.0) {
		tmp = t_0;
	} else if (z <= 7e-5) {
		tmp = (sin(y) + z) + x;
	} else if (z <= 8.6e+189) {
		tmp = t_0;
	} else {
		tmp = fma(cos(y), z, (x + y));
	}
	return tmp;
}
function code(x, y, z)
	t_0 = fma(x, Float64(Float64(z * cos(y)) / x), x)
	tmp = 0.0
	if (z <= -460000000.0)
		tmp = t_0;
	elseif (z <= 7e-5)
		tmp = Float64(Float64(sin(y) + z) + x);
	elseif (z <= 8.6e+189)
		tmp = t_0;
	else
		tmp = fma(cos(y), z, Float64(x + y));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -460000000.0], t$95$0, If[LessEqual[z, 7e-5], N[(N[(N[Sin[y], $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 8.6e+189], t$95$0, N[(N[Cos[y], $MachinePrecision] * z + N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x, \frac{z \cdot \cos y}{x}, x\right)\\
\mathbf{if}\;z \leq -460000000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 7 \cdot 10^{-5}:\\
\;\;\;\;\left(\sin y + z\right) + x\\

\mathbf{elif}\;z \leq 8.6 \cdot 10^{+189}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\cos y, z, x + y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.6e8 or 6.9999999999999994e-5 < z < 8.59999999999999995e189

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
      6. +-commutativeN/A

        \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
      7. *-commutativeN/A

        \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
      8. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
      10. +-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
      12. lift-sin.f6499.9

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
    5. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
      2. *-rgt-identityN/A

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
      5. div-add-revN/A

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

        \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
      9. lift-sin.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
      10. lift-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
      11. lift-cos.f6488.1

        \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
    6. Applied rewrites88.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
    7. Taylor expanded in z around inf

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y}{x}, x\right) \]
      3. lift-cos.f6471.5

        \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y}{x}, x\right) \]
    9. Applied rewrites71.5%

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

    if -4.6e8 < z < 6.9999999999999994e-5

    1. Initial program 99.9%

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

      \[\leadsto \left(x + \sin y\right) + \color{blue}{z} \]
    3. Step-by-step derivation
      1. Applied rewrites82.2%

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\sin y + z\right) + x} \]
        7. lower-+.f64N/A

          \[\leadsto \color{blue}{\left(\sin y + z\right)} + x \]
        8. lift-sin.f6482.2

          \[\leadsto \left(\color{blue}{\sin y} + z\right) + x \]
      3. Applied rewrites82.2%

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

      if 8.59999999999999995e189 < z

      1. Initial program 99.9%

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

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

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

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

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

          \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
        6. +-commutativeN/A

          \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
        7. *-commutativeN/A

          \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
        8. lower-fma.f64N/A

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
        10. +-commutativeN/A

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

          \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
        12. lift-sin.f6499.9

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

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

        \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{x + y}\right) \]
      5. Step-by-step derivation
        1. lower-+.f6470.8

          \[\leadsto \mathsf{fma}\left(\cos y, z, x + \color{blue}{y}\right) \]
      6. Applied rewrites70.8%

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

    Alternative 4: 89.3% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -4.9 \cdot 10^{+144}:\\ \;\;\;\;\left(x + y\right) + t\_0\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+134}:\\ \;\;\;\;\left(\sin y + z\right) + x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (* z (cos y))))
       (if (<= z -4.9e+144)
         (+ (+ x y) t_0)
         (if (<= z 1.7e+134) (+ (+ (sin y) z) x) t_0))))
    double code(double x, double y, double z) {
    	double t_0 = z * cos(y);
    	double tmp;
    	if (z <= -4.9e+144) {
    		tmp = (x + y) + t_0;
    	} else if (z <= 1.7e+134) {
    		tmp = (sin(y) + z) + x;
    	} else {
    		tmp = t_0;
    	}
    	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)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: t_0
        real(8) :: tmp
        t_0 = z * cos(y)
        if (z <= (-4.9d+144)) then
            tmp = (x + y) + t_0
        else if (z <= 1.7d+134) then
            tmp = (sin(y) + z) + x
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double t_0 = z * Math.cos(y);
    	double tmp;
    	if (z <= -4.9e+144) {
    		tmp = (x + y) + t_0;
    	} else if (z <= 1.7e+134) {
    		tmp = (Math.sin(y) + z) + x;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = z * math.cos(y)
    	tmp = 0
    	if z <= -4.9e+144:
    		tmp = (x + y) + t_0
    	elif z <= 1.7e+134:
    		tmp = (math.sin(y) + z) + x
    	else:
    		tmp = t_0
    	return tmp
    
    function code(x, y, z)
    	t_0 = Float64(z * cos(y))
    	tmp = 0.0
    	if (z <= -4.9e+144)
    		tmp = Float64(Float64(x + y) + t_0);
    	elseif (z <= 1.7e+134)
    		tmp = Float64(Float64(sin(y) + z) + x);
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = z * cos(y);
    	tmp = 0.0;
    	if (z <= -4.9e+144)
    		tmp = (x + y) + t_0;
    	elseif (z <= 1.7e+134)
    		tmp = (sin(y) + z) + x;
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+144], N[(N[(x + y), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[z, 1.7e+134], N[(N[(N[Sin[y], $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := z \cdot \cos y\\
    \mathbf{if}\;z \leq -4.9 \cdot 10^{+144}:\\
    \;\;\;\;\left(x + y\right) + t\_0\\
    
    \mathbf{elif}\;z \leq 1.7 \cdot 10^{+134}:\\
    \;\;\;\;\left(\sin y + z\right) + x\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -4.9e144

      1. Initial program 99.9%

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

        \[\leadsto \left(x + \color{blue}{y}\right) + z \cdot \cos y \]
      3. Step-by-step derivation
        1. Applied rewrites70.8%

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

        if -4.9e144 < z < 1.70000000000000009e134

        1. Initial program 99.9%

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

          \[\leadsto \left(x + \sin y\right) + \color{blue}{z} \]
        3. Step-by-step derivation
          1. Applied rewrites82.2%

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(\sin y + z\right) + x} \]
            7. lower-+.f64N/A

              \[\leadsto \color{blue}{\left(\sin y + z\right)} + x \]
            8. lift-sin.f6482.2

              \[\leadsto \left(\color{blue}{\sin y} + z\right) + x \]
          3. Applied rewrites82.2%

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

          if 1.70000000000000009e134 < z

          1. Initial program 99.9%

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

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

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

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

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

              \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
            6. +-commutativeN/A

              \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
            7. *-commutativeN/A

              \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
            8. lower-fma.f64N/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
            10. +-commutativeN/A

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

              \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
            12. lift-sin.f6499.9

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

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

            \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
          5. Step-by-step derivation
            1. distribute-lft-inN/A

              \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
            2. *-rgt-identityN/A

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

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

              \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
            5. div-add-revN/A

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

              \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
            7. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
            8. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
            9. lift-sin.f64N/A

              \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
            10. lift-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
            11. lift-cos.f6488.1

              \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
          6. Applied rewrites88.1%

            \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
          7. Taylor expanded in z around inf

            \[\leadsto \mathsf{fma}\left(x, z \cdot \color{blue}{\left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right)}, x\right) \]
          8. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(x, \left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right) \cdot z, x\right) \]
            2. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(x, \left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right) \cdot z, x\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
            4. lower-+.f64N/A

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

              \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
            6. lift-sin.f64N/A

              \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
            7. lower-*.f64N/A

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

              \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
            9. lift-cos.f6476.2

              \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
          9. Applied rewrites76.2%

            \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot \color{blue}{z}, x\right) \]
          10. Taylor expanded in z around inf

            \[\leadsto \color{blue}{z \cdot \cos y} \]
          11. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto z \cdot \cos y \]
            2. +-commutativeN/A

              \[\leadsto \color{blue}{z} \cdot \cos y \]
            3. +-commutativeN/A

              \[\leadsto z \cdot \cos y \]
            4. lower-*.f64N/A

              \[\leadsto z \cdot \color{blue}{\cos y} \]
            5. lift-cos.f6442.8

              \[\leadsto z \cdot \cos y \]
          12. Applied rewrites42.8%

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

        Alternative 5: 89.3% accurate, 1.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.9 \cdot 10^{+144}:\\ \;\;\;\;\mathsf{fma}\left(\cos y, z, x + y\right)\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+134}:\\ \;\;\;\;\left(\sin y + z\right) + x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \cos y\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= z -4.9e+144)
           (fma (cos y) z (+ x y))
           (if (<= z 1.7e+134) (+ (+ (sin y) z) x) (* z (cos y)))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (z <= -4.9e+144) {
        		tmp = fma(cos(y), z, (x + y));
        	} else if (z <= 1.7e+134) {
        		tmp = (sin(y) + z) + x;
        	} else {
        		tmp = z * cos(y);
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	tmp = 0.0
        	if (z <= -4.9e+144)
        		tmp = fma(cos(y), z, Float64(x + y));
        	elseif (z <= 1.7e+134)
        		tmp = Float64(Float64(sin(y) + z) + x);
        	else
        		tmp = Float64(z * cos(y));
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := If[LessEqual[z, -4.9e+144], N[(N[Cos[y], $MachinePrecision] * z + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+134], N[(N[(N[Sin[y], $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision], N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -4.9 \cdot 10^{+144}:\\
        \;\;\;\;\mathsf{fma}\left(\cos y, z, x + y\right)\\
        
        \mathbf{elif}\;z \leq 1.7 \cdot 10^{+134}:\\
        \;\;\;\;\left(\sin y + z\right) + x\\
        
        \mathbf{else}:\\
        \;\;\;\;z \cdot \cos y\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < -4.9e144

          1. Initial program 99.9%

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

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

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

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

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

              \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
            6. +-commutativeN/A

              \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
            7. *-commutativeN/A

              \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
            8. lower-fma.f64N/A

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
            10. +-commutativeN/A

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

              \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
            12. lift-sin.f6499.9

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

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

            \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{x + y}\right) \]
          5. Step-by-step derivation
            1. lower-+.f6470.8

              \[\leadsto \mathsf{fma}\left(\cos y, z, x + \color{blue}{y}\right) \]
          6. Applied rewrites70.8%

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

          if -4.9e144 < z < 1.70000000000000009e134

          1. Initial program 99.9%

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

            \[\leadsto \left(x + \sin y\right) + \color{blue}{z} \]
          3. Step-by-step derivation
            1. Applied rewrites82.2%

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left(\sin y + z\right) + x} \]
              7. lower-+.f64N/A

                \[\leadsto \color{blue}{\left(\sin y + z\right)} + x \]
              8. lift-sin.f6482.2

                \[\leadsto \left(\color{blue}{\sin y} + z\right) + x \]
            3. Applied rewrites82.2%

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

            if 1.70000000000000009e134 < z

            1. Initial program 99.9%

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

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

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

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

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

                \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
              6. +-commutativeN/A

                \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
              7. *-commutativeN/A

                \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
              8. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
              10. +-commutativeN/A

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

                \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
              12. lift-sin.f6499.9

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

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

              \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
            5. Step-by-step derivation
              1. distribute-lft-inN/A

                \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
              2. *-rgt-identityN/A

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

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

                \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
              5. div-add-revN/A

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

                \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
              7. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
              8. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
              9. lift-sin.f64N/A

                \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
              10. lift-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
              11. lift-cos.f6488.1

                \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
            6. Applied rewrites88.1%

              \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
            7. Taylor expanded in z around inf

              \[\leadsto \mathsf{fma}\left(x, z \cdot \color{blue}{\left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right)}, x\right) \]
            8. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right) \cdot z, x\right) \]
              2. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right) \cdot z, x\right) \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
              4. lower-+.f64N/A

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

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
              6. lift-sin.f64N/A

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
              7. lower-*.f64N/A

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

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
              9. lift-cos.f6476.2

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
            9. Applied rewrites76.2%

              \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot \color{blue}{z}, x\right) \]
            10. Taylor expanded in z around inf

              \[\leadsto \color{blue}{z \cdot \cos y} \]
            11. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto z \cdot \cos y \]
              2. +-commutativeN/A

                \[\leadsto \color{blue}{z} \cdot \cos y \]
              3. +-commutativeN/A

                \[\leadsto z \cdot \cos y \]
              4. lower-*.f64N/A

                \[\leadsto z \cdot \color{blue}{\cos y} \]
              5. lift-cos.f6442.8

                \[\leadsto z \cdot \cos y \]
            12. Applied rewrites42.8%

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

          Alternative 6: 89.2% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+151}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+134}:\\ \;\;\;\;\left(\sin y + z\right) + x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (* z (cos y))))
             (if (<= z -7.5e+151) t_0 (if (<= z 1.7e+134) (+ (+ (sin y) z) x) t_0))))
          double code(double x, double y, double z) {
          	double t_0 = z * cos(y);
          	double tmp;
          	if (z <= -7.5e+151) {
          		tmp = t_0;
          	} else if (z <= 1.7e+134) {
          		tmp = (sin(y) + z) + x;
          	} else {
          		tmp = t_0;
          	}
          	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)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8) :: t_0
              real(8) :: tmp
              t_0 = z * cos(y)
              if (z <= (-7.5d+151)) then
                  tmp = t_0
              else if (z <= 1.7d+134) then
                  tmp = (sin(y) + z) + x
              else
                  tmp = t_0
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double t_0 = z * Math.cos(y);
          	double tmp;
          	if (z <= -7.5e+151) {
          		tmp = t_0;
          	} else if (z <= 1.7e+134) {
          		tmp = (Math.sin(y) + z) + x;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	t_0 = z * math.cos(y)
          	tmp = 0
          	if z <= -7.5e+151:
          		tmp = t_0
          	elif z <= 1.7e+134:
          		tmp = (math.sin(y) + z) + x
          	else:
          		tmp = t_0
          	return tmp
          
          function code(x, y, z)
          	t_0 = Float64(z * cos(y))
          	tmp = 0.0
          	if (z <= -7.5e+151)
          		tmp = t_0;
          	elseif (z <= 1.7e+134)
          		tmp = Float64(Float64(sin(y) + z) + x);
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	t_0 = z * cos(y);
          	tmp = 0.0;
          	if (z <= -7.5e+151)
          		tmp = t_0;
          	elseif (z <= 1.7e+134)
          		tmp = (sin(y) + z) + x;
          	else
          		tmp = t_0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e+151], t$95$0, If[LessEqual[z, 1.7e+134], N[(N[(N[Sin[y], $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := z \cdot \cos y\\
          \mathbf{if}\;z \leq -7.5 \cdot 10^{+151}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;z \leq 1.7 \cdot 10^{+134}:\\
          \;\;\;\;\left(\sin y + z\right) + x\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -7.49999999999999977e151 or 1.70000000000000009e134 < z

            1. Initial program 99.9%

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

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

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

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

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

                \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
              6. +-commutativeN/A

                \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
              7. *-commutativeN/A

                \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
              8. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
              10. +-commutativeN/A

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

                \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
              12. lift-sin.f6499.9

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

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

              \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
            5. Step-by-step derivation
              1. distribute-lft-inN/A

                \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
              2. *-rgt-identityN/A

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

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

                \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
              5. div-add-revN/A

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

                \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
              7. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
              8. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
              9. lift-sin.f64N/A

                \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
              10. lift-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
              11. lift-cos.f6488.1

                \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
            6. Applied rewrites88.1%

              \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
            7. Taylor expanded in z around inf

              \[\leadsto \mathsf{fma}\left(x, z \cdot \color{blue}{\left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right)}, x\right) \]
            8. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right) \cdot z, x\right) \]
              2. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right) \cdot z, x\right) \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
              4. lower-+.f64N/A

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

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
              6. lift-sin.f64N/A

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
              7. lower-*.f64N/A

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

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
              9. lift-cos.f6476.2

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
            9. Applied rewrites76.2%

              \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot \color{blue}{z}, x\right) \]
            10. Taylor expanded in z around inf

              \[\leadsto \color{blue}{z \cdot \cos y} \]
            11. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto z \cdot \cos y \]
              2. +-commutativeN/A

                \[\leadsto \color{blue}{z} \cdot \cos y \]
              3. +-commutativeN/A

                \[\leadsto z \cdot \cos y \]
              4. lower-*.f64N/A

                \[\leadsto z \cdot \color{blue}{\cos y} \]
              5. lift-cos.f6442.8

                \[\leadsto z \cdot \cos y \]
            12. Applied rewrites42.8%

              \[\leadsto \color{blue}{z \cdot \cos y} \]

            if -7.49999999999999977e151 < z < 1.70000000000000009e134

            1. Initial program 99.9%

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

              \[\leadsto \left(x + \sin y\right) + \color{blue}{z} \]
            3. Step-by-step derivation
              1. Applied rewrites82.2%

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\sin y + z\right) + x} \]
                7. lower-+.f64N/A

                  \[\leadsto \color{blue}{\left(\sin y + z\right)} + x \]
                8. lift-sin.f6482.2

                  \[\leadsto \left(\color{blue}{\sin y} + z\right) + x \]
              3. Applied rewrites82.2%

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

            Alternative 7: 84.6% accurate, 1.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+151}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1150000000:\\ \;\;\;\;z + x\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-56}:\\ \;\;\;\;\sin y + x\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+134}:\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (* z (cos y))))
               (if (<= z -7.5e+151)
                 t_0
                 (if (<= z -1150000000.0)
                   (+ z x)
                   (if (<= z 1.85e-56) (+ (sin y) x) (if (<= z 1.7e+134) (+ z x) t_0))))))
            double code(double x, double y, double z) {
            	double t_0 = z * cos(y);
            	double tmp;
            	if (z <= -7.5e+151) {
            		tmp = t_0;
            	} else if (z <= -1150000000.0) {
            		tmp = z + x;
            	} else if (z <= 1.85e-56) {
            		tmp = sin(y) + x;
            	} else if (z <= 1.7e+134) {
            		tmp = z + x;
            	} else {
            		tmp = t_0;
            	}
            	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)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: t_0
                real(8) :: tmp
                t_0 = z * cos(y)
                if (z <= (-7.5d+151)) then
                    tmp = t_0
                else if (z <= (-1150000000.0d0)) then
                    tmp = z + x
                else if (z <= 1.85d-56) then
                    tmp = sin(y) + x
                else if (z <= 1.7d+134) then
                    tmp = z + x
                else
                    tmp = t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = z * Math.cos(y);
            	double tmp;
            	if (z <= -7.5e+151) {
            		tmp = t_0;
            	} else if (z <= -1150000000.0) {
            		tmp = z + x;
            	} else if (z <= 1.85e-56) {
            		tmp = Math.sin(y) + x;
            	} else if (z <= 1.7e+134) {
            		tmp = z + x;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = z * math.cos(y)
            	tmp = 0
            	if z <= -7.5e+151:
            		tmp = t_0
            	elif z <= -1150000000.0:
            		tmp = z + x
            	elif z <= 1.85e-56:
            		tmp = math.sin(y) + x
            	elif z <= 1.7e+134:
            		tmp = z + x
            	else:
            		tmp = t_0
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(z * cos(y))
            	tmp = 0.0
            	if (z <= -7.5e+151)
            		tmp = t_0;
            	elseif (z <= -1150000000.0)
            		tmp = Float64(z + x);
            	elseif (z <= 1.85e-56)
            		tmp = Float64(sin(y) + x);
            	elseif (z <= 1.7e+134)
            		tmp = Float64(z + x);
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = z * cos(y);
            	tmp = 0.0;
            	if (z <= -7.5e+151)
            		tmp = t_0;
            	elseif (z <= -1150000000.0)
            		tmp = z + x;
            	elseif (z <= 1.85e-56)
            		tmp = sin(y) + x;
            	elseif (z <= 1.7e+134)
            		tmp = z + x;
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e+151], t$95$0, If[LessEqual[z, -1150000000.0], N[(z + x), $MachinePrecision], If[LessEqual[z, 1.85e-56], N[(N[Sin[y], $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.7e+134], N[(z + x), $MachinePrecision], t$95$0]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := z \cdot \cos y\\
            \mathbf{if}\;z \leq -7.5 \cdot 10^{+151}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;z \leq -1150000000:\\
            \;\;\;\;z + x\\
            
            \mathbf{elif}\;z \leq 1.85 \cdot 10^{-56}:\\
            \;\;\;\;\sin y + x\\
            
            \mathbf{elif}\;z \leq 1.7 \cdot 10^{+134}:\\
            \;\;\;\;z + x\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if z < -7.49999999999999977e151 or 1.70000000000000009e134 < z

              1. Initial program 99.9%

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

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

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

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

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

                  \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
                6. +-commutativeN/A

                  \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
                7. *-commutativeN/A

                  \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
                8. lower-fma.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
                10. +-commutativeN/A

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

                  \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
                12. lift-sin.f6499.9

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

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

                \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
              5. Step-by-step derivation
                1. distribute-lft-inN/A

                  \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
                2. *-rgt-identityN/A

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

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

                  \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
                5. div-add-revN/A

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

                  \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
                7. +-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
                8. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                9. lift-sin.f64N/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                10. lift-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
                11. lift-cos.f6488.1

                  \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
              6. Applied rewrites88.1%

                \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
              7. Taylor expanded in z around inf

                \[\leadsto \mathsf{fma}\left(x, z \cdot \color{blue}{\left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right)}, x\right) \]
              8. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(x, \left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right) \cdot z, x\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \mathsf{fma}\left(x, \left(\frac{\cos y}{x} + \frac{\sin y}{x \cdot z}\right) \cdot z, x\right) \]
                3. +-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
                4. lower-+.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
                6. lift-sin.f64N/A

                  \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
                7. lower-*.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
                9. lift-cos.f6476.2

                  \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot z, x\right) \]
              9. Applied rewrites76.2%

                \[\leadsto \mathsf{fma}\left(x, \left(\frac{\sin y}{x \cdot z} + \frac{\cos y}{x}\right) \cdot \color{blue}{z}, x\right) \]
              10. Taylor expanded in z around inf

                \[\leadsto \color{blue}{z \cdot \cos y} \]
              11. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto z \cdot \cos y \]
                2. +-commutativeN/A

                  \[\leadsto \color{blue}{z} \cdot \cos y \]
                3. +-commutativeN/A

                  \[\leadsto z \cdot \cos y \]
                4. lower-*.f64N/A

                  \[\leadsto z \cdot \color{blue}{\cos y} \]
                5. lift-cos.f6442.8

                  \[\leadsto z \cdot \cos y \]
              12. Applied rewrites42.8%

                \[\leadsto \color{blue}{z \cdot \cos y} \]

              if -7.49999999999999977e151 < z < -1.15e9 or 1.8500000000000001e-56 < z < 1.70000000000000009e134

              1. Initial program 99.9%

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

                \[\leadsto \color{blue}{x + z} \]
              3. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto z + \color{blue}{x} \]
                2. lower-+.f6466.2

                  \[\leadsto z + \color{blue}{x} \]
              4. Applied rewrites66.2%

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

              if -1.15e9 < z < 1.8500000000000001e-56

              1. Initial program 99.9%

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

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

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

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

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

                  \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
                6. +-commutativeN/A

                  \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
                7. *-commutativeN/A

                  \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
                8. lower-fma.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
                10. +-commutativeN/A

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

                  \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
                12. lift-sin.f6499.9

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

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

                \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
              5. Step-by-step derivation
                1. distribute-lft-inN/A

                  \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
                2. *-rgt-identityN/A

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

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

                  \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
                5. div-add-revN/A

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

                  \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
                7. +-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
                8. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                9. lift-sin.f64N/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                10. lift-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
                11. lift-cos.f6488.1

                  \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
              6. Applied rewrites88.1%

                \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
              7. Taylor expanded in z around 0

                \[\leadsto \color{blue}{x + \sin y} \]
              8. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \sin y + \color{blue}{x} \]
                2. lower-+.f64N/A

                  \[\leadsto \sin y + \color{blue}{x} \]
                3. lift-sin.f6458.5

                  \[\leadsto \sin y + x \]
              9. Applied rewrites58.5%

                \[\leadsto \color{blue}{\sin y + x} \]
            3. Recombined 3 regimes into one program.
            4. Add Preprocessing

            Alternative 8: 80.1% accurate, 0.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + \sin y\right) + z \cdot \cos y\\ \mathbf{if}\;t\_0 \leq -1000000000:\\ \;\;\;\;z + x\\ \mathbf{elif}\;t\_0 \leq -0.2:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;t\_0 \leq 10^{-12}:\\ \;\;\;\;\left(x + \mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right) \cdot y\right) + z\\ \mathbf{elif}\;t\_0 \leq 1:\\ \;\;\;\;\sin y\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (+ (+ x (sin y)) (* z (cos y)))))
               (if (<= t_0 -1000000000.0)
                 (+ z x)
                 (if (<= t_0 -0.2)
                   (sin y)
                   (if (<= t_0 1e-12)
                     (+ (+ x (* (fma (* y y) -0.16666666666666666 1.0) y)) z)
                     (if (<= t_0 1.0) (sin y) (+ z x)))))))
            double code(double x, double y, double z) {
            	double t_0 = (x + sin(y)) + (z * cos(y));
            	double tmp;
            	if (t_0 <= -1000000000.0) {
            		tmp = z + x;
            	} else if (t_0 <= -0.2) {
            		tmp = sin(y);
            	} else if (t_0 <= 1e-12) {
            		tmp = (x + (fma((y * y), -0.16666666666666666, 1.0) * y)) + z;
            	} else if (t_0 <= 1.0) {
            		tmp = sin(y);
            	} else {
            		tmp = z + x;
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	t_0 = Float64(Float64(x + sin(y)) + Float64(z * cos(y)))
            	tmp = 0.0
            	if (t_0 <= -1000000000.0)
            		tmp = Float64(z + x);
            	elseif (t_0 <= -0.2)
            		tmp = sin(y);
            	elseif (t_0 <= 1e-12)
            		tmp = Float64(Float64(x + Float64(fma(Float64(y * y), -0.16666666666666666, 1.0) * y)) + z);
            	elseif (t_0 <= 1.0)
            		tmp = sin(y);
            	else
            		tmp = Float64(z + x);
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1000000000.0], N[(z + x), $MachinePrecision], If[LessEqual[t$95$0, -0.2], N[Sin[y], $MachinePrecision], If[LessEqual[t$95$0, 1e-12], N[(N[(x + N[(N[(N[(y * y), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[y], $MachinePrecision], N[(z + x), $MachinePrecision]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(x + \sin y\right) + z \cdot \cos y\\
            \mathbf{if}\;t\_0 \leq -1000000000:\\
            \;\;\;\;z + x\\
            
            \mathbf{elif}\;t\_0 \leq -0.2:\\
            \;\;\;\;\sin y\\
            
            \mathbf{elif}\;t\_0 \leq 10^{-12}:\\
            \;\;\;\;\left(x + \mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right) \cdot y\right) + z\\
            
            \mathbf{elif}\;t\_0 \leq 1:\\
            \;\;\;\;\sin y\\
            
            \mathbf{else}:\\
            \;\;\;\;z + x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -1e9 or 1 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y)))

              1. Initial program 99.9%

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

                \[\leadsto \color{blue}{x + z} \]
              3. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto z + \color{blue}{x} \]
                2. lower-+.f6466.2

                  \[\leadsto z + \color{blue}{x} \]
              4. Applied rewrites66.2%

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

              if -1e9 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -0.20000000000000001 or 9.9999999999999998e-13 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 1

              1. Initial program 99.9%

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

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

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

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

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

                  \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
                6. +-commutativeN/A

                  \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
                7. *-commutativeN/A

                  \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
                8. lower-fma.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
                10. +-commutativeN/A

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

                  \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
                12. lift-sin.f6499.9

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

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

                \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
              5. Step-by-step derivation
                1. distribute-lft-inN/A

                  \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
                2. *-rgt-identityN/A

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

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

                  \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
                5. div-add-revN/A

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

                  \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
                7. +-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
                8. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                9. lift-sin.f64N/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                10. lift-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
                11. lift-cos.f6488.1

                  \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
              6. Applied rewrites88.1%

                \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
              7. Taylor expanded in z around 0

                \[\leadsto \color{blue}{x + \sin y} \]
              8. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \sin y + \color{blue}{x} \]
                2. lower-+.f64N/A

                  \[\leadsto \sin y + \color{blue}{x} \]
                3. lift-sin.f6458.5

                  \[\leadsto \sin y + x \]
              9. Applied rewrites58.5%

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

                \[\leadsto \sin y \]
              11. Step-by-step derivation
                1. lift-sin.f6418.2

                  \[\leadsto \sin y \]
              12. Applied rewrites18.2%

                \[\leadsto \sin y \]

              if -0.20000000000000001 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 9.9999999999999998e-13

              1. Initial program 99.9%

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

                \[\leadsto \left(x + \sin y\right) + \color{blue}{z} \]
              3. Step-by-step derivation
                1. Applied rewrites82.2%

                  \[\leadsto \left(x + \sin y\right) + \color{blue}{z} \]
                2. Taylor expanded in y around 0

                  \[\leadsto \left(x + \color{blue}{y \cdot \left(1 + \frac{-1}{6} \cdot {y}^{2}\right)}\right) + z \]
                3. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

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

                    \[\leadsto \left(x + \mathsf{fma}\left({y}^{2}, \frac{-1}{6}, 1\right) \cdot y\right) + z \]
                  6. unpow2N/A

                    \[\leadsto \left(x + \mathsf{fma}\left(y \cdot y, \frac{-1}{6}, 1\right) \cdot y\right) + z \]
                  7. lower-*.f6454.7

                    \[\leadsto \left(x + \mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right) \cdot y\right) + z \]
                4. Applied rewrites54.7%

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

              Alternative 9: 79.5% accurate, 1.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin y + x\\ \mathbf{if}\;y \leq -4.8 \cdot 10^{-5}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-38}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, -0.5, 1\right), y, z + x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (let* ((t_0 (+ (sin y) x)))
                 (if (<= y -4.8e-5)
                   t_0
                   (if (<= y 3.7e-38) (fma (fma (* z y) -0.5 1.0) y (+ z x)) t_0))))
              double code(double x, double y, double z) {
              	double t_0 = sin(y) + x;
              	double tmp;
              	if (y <= -4.8e-5) {
              		tmp = t_0;
              	} else if (y <= 3.7e-38) {
              		tmp = fma(fma((z * y), -0.5, 1.0), y, (z + x));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	t_0 = Float64(sin(y) + x)
              	tmp = 0.0
              	if (y <= -4.8e-5)
              		tmp = t_0;
              	elseif (y <= 3.7e-38)
              		tmp = fma(fma(Float64(z * y), -0.5, 1.0), y, Float64(z + x));
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -4.8e-5], t$95$0, If[LessEqual[y, 3.7e-38], N[(N[(N[(z * y), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] * y + N[(z + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \sin y + x\\
              \mathbf{if}\;y \leq -4.8 \cdot 10^{-5}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;y \leq 3.7 \cdot 10^{-38}:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, -0.5, 1\right), y, z + x\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < -4.8000000000000001e-5 or 3.7e-38 < y

                1. Initial program 99.9%

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

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

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

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

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

                    \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
                  6. +-commutativeN/A

                    \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
                  7. *-commutativeN/A

                    \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
                  8. lower-fma.f64N/A

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

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
                  10. +-commutativeN/A

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

                    \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
                  12. lift-sin.f6499.9

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

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

                  \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
                5. Step-by-step derivation
                  1. distribute-lft-inN/A

                    \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
                  2. *-rgt-identityN/A

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

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

                    \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
                  5. div-add-revN/A

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

                    \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
                  7. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                  9. lift-sin.f64N/A

                    \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                  10. lift-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
                  11. lift-cos.f6488.1

                    \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
                6. Applied rewrites88.1%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
                7. Taylor expanded in z around 0

                  \[\leadsto \color{blue}{x + \sin y} \]
                8. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \sin y + \color{blue}{x} \]
                  2. lower-+.f64N/A

                    \[\leadsto \sin y + \color{blue}{x} \]
                  3. lift-sin.f6458.5

                    \[\leadsto \sin y + x \]
                9. Applied rewrites58.5%

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

                if -4.8000000000000001e-5 < y < 3.7e-38

                1. Initial program 99.9%

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot z\right) + 1, y, x + z\right) \]
                  6. *-commutativeN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, \frac{-1}{2}, 1\right), y, x + z\right) \]
                  10. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, \frac{-1}{2}, 1\right), y, z + x\right) \]
                  11. lower-+.f6457.0

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, -0.5, 1\right), y, z + x\right) \]
                4. Applied rewrites57.0%

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

              Alternative 10: 70.6% accurate, 2.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6400:\\ \;\;\;\;z + x\\ \mathbf{elif}\;y \leq 23000:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, z\right) + x\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (<= y -6400.0)
                 (+ z x)
                 (if (<= y 23000.0)
                   (+ (fma (fma (fma -0.16666666666666666 y (* -0.5 z)) y 1.0) y z) x)
                   (+ z x))))
              double code(double x, double y, double z) {
              	double tmp;
              	if (y <= -6400.0) {
              		tmp = z + x;
              	} else if (y <= 23000.0) {
              		tmp = fma(fma(fma(-0.16666666666666666, y, (-0.5 * z)), y, 1.0), y, z) + x;
              	} else {
              		tmp = z + x;
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if (y <= -6400.0)
              		tmp = Float64(z + x);
              	elseif (y <= 23000.0)
              		tmp = Float64(fma(fma(fma(-0.16666666666666666, y, Float64(-0.5 * z)), y, 1.0), y, z) + x);
              	else
              		tmp = Float64(z + x);
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := If[LessEqual[y, -6400.0], N[(z + x), $MachinePrecision], If[LessEqual[y, 23000.0], N[(N[(N[(N[(-0.16666666666666666 * y + N[(-0.5 * z), $MachinePrecision]), $MachinePrecision] * y + 1.0), $MachinePrecision] * y + z), $MachinePrecision] + x), $MachinePrecision], N[(z + x), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y \leq -6400:\\
              \;\;\;\;z + x\\
              
              \mathbf{elif}\;y \leq 23000:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, z\right) + x\\
              
              \mathbf{else}:\\
              \;\;\;\;z + x\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < -6400 or 23000 < y

                1. Initial program 99.9%

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

                  \[\leadsto \color{blue}{x + z} \]
                3. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto z + \color{blue}{x} \]
                  2. lower-+.f6466.2

                    \[\leadsto z + \color{blue}{x} \]
                4. Applied rewrites66.2%

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

                if -6400 < y < 23000

                1. Initial program 99.9%

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(1 + y \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right), y, z\right) + x \]
                  6. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(y \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right) + 1, y, z\right) + x \]
                  7. *-commutativeN/A

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y, y, 1\right), y, z\right) + x \]
                  9. +-commutativeN/A

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{6}, y, \frac{-1}{2} \cdot z\right), y, 1\right), y, z\right) + x \]
                  11. lower-*.f6454.1

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, z\right) + x \]
                4. Applied rewrites54.1%

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

              Alternative 11: 70.5% accurate, 2.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5500:\\ \;\;\;\;z + x\\ \mathbf{elif}\;y \leq 10600:\\ \;\;\;\;\left(x + \mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right) \cdot y\right) + z\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (<= y -5500.0)
                 (+ z x)
                 (if (<= y 10600.0)
                   (+ (+ x (* (fma (* y y) -0.16666666666666666 1.0) y)) z)
                   (+ z x))))
              double code(double x, double y, double z) {
              	double tmp;
              	if (y <= -5500.0) {
              		tmp = z + x;
              	} else if (y <= 10600.0) {
              		tmp = (x + (fma((y * y), -0.16666666666666666, 1.0) * y)) + z;
              	} else {
              		tmp = z + x;
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if (y <= -5500.0)
              		tmp = Float64(z + x);
              	elseif (y <= 10600.0)
              		tmp = Float64(Float64(x + Float64(fma(Float64(y * y), -0.16666666666666666, 1.0) * y)) + z);
              	else
              		tmp = Float64(z + x);
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := If[LessEqual[y, -5500.0], N[(z + x), $MachinePrecision], If[LessEqual[y, 10600.0], N[(N[(x + N[(N[(N[(y * y), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], N[(z + x), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y \leq -5500:\\
              \;\;\;\;z + x\\
              
              \mathbf{elif}\;y \leq 10600:\\
              \;\;\;\;\left(x + \mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right) \cdot y\right) + z\\
              
              \mathbf{else}:\\
              \;\;\;\;z + x\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < -5500 or 10600 < y

                1. Initial program 99.9%

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

                  \[\leadsto \color{blue}{x + z} \]
                3. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto z + \color{blue}{x} \]
                  2. lower-+.f6466.2

                    \[\leadsto z + \color{blue}{x} \]
                4. Applied rewrites66.2%

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

                if -5500 < y < 10600

                1. Initial program 99.9%

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

                  \[\leadsto \left(x + \sin y\right) + \color{blue}{z} \]
                3. Step-by-step derivation
                  1. Applied rewrites82.2%

                    \[\leadsto \left(x + \sin y\right) + \color{blue}{z} \]
                  2. Taylor expanded in y around 0

                    \[\leadsto \left(x + \color{blue}{y \cdot \left(1 + \frac{-1}{6} \cdot {y}^{2}\right)}\right) + z \]
                  3. Step-by-step derivation
                    1. *-commutativeN/A

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

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

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

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

                      \[\leadsto \left(x + \mathsf{fma}\left({y}^{2}, \frac{-1}{6}, 1\right) \cdot y\right) + z \]
                    6. unpow2N/A

                      \[\leadsto \left(x + \mathsf{fma}\left(y \cdot y, \frac{-1}{6}, 1\right) \cdot y\right) + z \]
                    7. lower-*.f6454.7

                      \[\leadsto \left(x + \mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right) \cdot y\right) + z \]
                  4. Applied rewrites54.7%

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

                Alternative 12: 70.5% accurate, 3.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3600000:\\ \;\;\;\;z + x\\ \mathbf{elif}\;y \leq 4.6:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, -0.5, 1\right), y, z + x\right)\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= y -3600000.0)
                   (+ z x)
                   (if (<= y 4.6) (fma (fma (* z y) -0.5 1.0) y (+ z x)) (+ z x))))
                double code(double x, double y, double z) {
                	double tmp;
                	if (y <= -3600000.0) {
                		tmp = z + x;
                	} else if (y <= 4.6) {
                		tmp = fma(fma((z * y), -0.5, 1.0), y, (z + x));
                	} else {
                		tmp = z + x;
                	}
                	return tmp;
                }
                
                function code(x, y, z)
                	tmp = 0.0
                	if (y <= -3600000.0)
                		tmp = Float64(z + x);
                	elseif (y <= 4.6)
                		tmp = fma(fma(Float64(z * y), -0.5, 1.0), y, Float64(z + x));
                	else
                		tmp = Float64(z + x);
                	end
                	return tmp
                end
                
                code[x_, y_, z_] := If[LessEqual[y, -3600000.0], N[(z + x), $MachinePrecision], If[LessEqual[y, 4.6], N[(N[(N[(z * y), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] * y + N[(z + x), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq -3600000:\\
                \;\;\;\;z + x\\
                
                \mathbf{elif}\;y \leq 4.6:\\
                \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, -0.5, 1\right), y, z + x\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;z + x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -3.6e6 or 4.5999999999999996 < y

                  1. Initial program 99.9%

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

                    \[\leadsto \color{blue}{x + z} \]
                  3. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto z + \color{blue}{x} \]
                    2. lower-+.f6466.2

                      \[\leadsto z + \color{blue}{x} \]
                  4. Applied rewrites66.2%

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

                  if -3.6e6 < y < 4.5999999999999996

                  1. Initial program 99.9%

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot z\right) + 1, y, x + z\right) \]
                    6. *-commutativeN/A

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

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

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

                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, \frac{-1}{2}, 1\right), y, x + z\right) \]
                    10. +-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, \frac{-1}{2}, 1\right), y, z + x\right) \]
                    11. lower-+.f6457.0

                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, -0.5, 1\right), y, z + x\right) \]
                  4. Applied rewrites57.0%

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

                Alternative 13: 70.4% accurate, 3.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3600000:\\ \;\;\;\;z + x\\ \mathbf{elif}\;y \leq 4.6:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, -0.5, 1\right), z, x + y\right)\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= y -3600000.0)
                   (+ z x)
                   (if (<= y 4.6) (fma (fma (* y y) -0.5 1.0) z (+ x y)) (+ z x))))
                double code(double x, double y, double z) {
                	double tmp;
                	if (y <= -3600000.0) {
                		tmp = z + x;
                	} else if (y <= 4.6) {
                		tmp = fma(fma((y * y), -0.5, 1.0), z, (x + y));
                	} else {
                		tmp = z + x;
                	}
                	return tmp;
                }
                
                function code(x, y, z)
                	tmp = 0.0
                	if (y <= -3600000.0)
                		tmp = Float64(z + x);
                	elseif (y <= 4.6)
                		tmp = fma(fma(Float64(y * y), -0.5, 1.0), z, Float64(x + y));
                	else
                		tmp = Float64(z + x);
                	end
                	return tmp
                end
                
                code[x_, y_, z_] := If[LessEqual[y, -3600000.0], N[(z + x), $MachinePrecision], If[LessEqual[y, 4.6], N[(N[(N[(y * y), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] * z + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq -3600000:\\
                \;\;\;\;z + x\\
                
                \mathbf{elif}\;y \leq 4.6:\\
                \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, -0.5, 1\right), z, x + y\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;z + x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -3.6e6 or 4.5999999999999996 < y

                  1. Initial program 99.9%

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

                    \[\leadsto \color{blue}{x + z} \]
                  3. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto z + \color{blue}{x} \]
                    2. lower-+.f6466.2

                      \[\leadsto z + \color{blue}{x} \]
                  4. Applied rewrites66.2%

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

                  if -3.6e6 < y < 4.5999999999999996

                  1. Initial program 99.9%

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(y \cdot z\right) + 1, y, x + z\right) \]
                    6. *-commutativeN/A

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

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

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

                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, \frac{-1}{2}, 1\right), y, x + z\right) \]
                    10. +-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, \frac{-1}{2}, 1\right), y, z + x\right) \]
                    11. lower-+.f6457.0

                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(z \cdot y, -0.5, 1\right), y, z + x\right) \]
                  4. Applied rewrites57.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(z + x\right) + \left(y + \left(\frac{-1}{2} \cdot z\right) \cdot \color{blue}{{y}^{2}}\right) \]
                    18. associate-+r+N/A

                      \[\leadsto \left(\left(z + x\right) + y\right) + \color{blue}{\left(\frac{-1}{2} \cdot z\right) \cdot {y}^{2}} \]
                  6. Applied rewrites56.3%

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

                Alternative 14: 70.3% accurate, 5.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{+41}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;y \leq 9.5:\\ \;\;\;\;\left(z + y\right) + x\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= y -3.8e+41) (+ z x) (if (<= y 9.5) (+ (+ z y) x) (+ z x))))
                double code(double x, double y, double z) {
                	double tmp;
                	if (y <= -3.8e+41) {
                		tmp = z + x;
                	} else if (y <= 9.5) {
                		tmp = (z + y) + x;
                	} else {
                		tmp = z + x;
                	}
                	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)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8) :: tmp
                    if (y <= (-3.8d+41)) then
                        tmp = z + x
                    else if (y <= 9.5d0) then
                        tmp = (z + y) + x
                    else
                        tmp = z + x
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double tmp;
                	if (y <= -3.8e+41) {
                		tmp = z + x;
                	} else if (y <= 9.5) {
                		tmp = (z + y) + x;
                	} else {
                		tmp = z + x;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	tmp = 0
                	if y <= -3.8e+41:
                		tmp = z + x
                	elif y <= 9.5:
                		tmp = (z + y) + x
                	else:
                		tmp = z + x
                	return tmp
                
                function code(x, y, z)
                	tmp = 0.0
                	if (y <= -3.8e+41)
                		tmp = Float64(z + x);
                	elseif (y <= 9.5)
                		tmp = Float64(Float64(z + y) + x);
                	else
                		tmp = Float64(z + x);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	tmp = 0.0;
                	if (y <= -3.8e+41)
                		tmp = z + x;
                	elseif (y <= 9.5)
                		tmp = (z + y) + x;
                	else
                		tmp = z + x;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := If[LessEqual[y, -3.8e+41], N[(z + x), $MachinePrecision], If[LessEqual[y, 9.5], N[(N[(z + y), $MachinePrecision] + x), $MachinePrecision], N[(z + x), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq -3.8 \cdot 10^{+41}:\\
                \;\;\;\;z + x\\
                
                \mathbf{elif}\;y \leq 9.5:\\
                \;\;\;\;\left(z + y\right) + x\\
                
                \mathbf{else}:\\
                \;\;\;\;z + x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -3.8000000000000001e41 or 9.5 < y

                  1. Initial program 99.9%

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

                    \[\leadsto \color{blue}{x + z} \]
                  3. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto z + \color{blue}{x} \]
                    2. lower-+.f6466.2

                      \[\leadsto z + \color{blue}{x} \]
                  4. Applied rewrites66.2%

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

                  if -3.8000000000000001e41 < y < 9.5

                  1. Initial program 99.9%

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

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

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

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

                      \[\leadsto \left(z + y\right) + x \]
                    4. lower-+.f6461.6

                      \[\leadsto \left(z + y\right) + x \]
                  4. Applied rewrites61.6%

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

                Alternative 15: 68.1% accurate, 6.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{-150}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{-154}:\\ \;\;\;\;z + y\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= x -4.9e-150) (+ z x) (if (<= x 1.22e-154) (+ z y) (+ z x))))
                double code(double x, double y, double z) {
                	double tmp;
                	if (x <= -4.9e-150) {
                		tmp = z + x;
                	} else if (x <= 1.22e-154) {
                		tmp = z + y;
                	} else {
                		tmp = z + x;
                	}
                	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)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8) :: tmp
                    if (x <= (-4.9d-150)) then
                        tmp = z + x
                    else if (x <= 1.22d-154) then
                        tmp = z + y
                    else
                        tmp = z + x
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double tmp;
                	if (x <= -4.9e-150) {
                		tmp = z + x;
                	} else if (x <= 1.22e-154) {
                		tmp = z + y;
                	} else {
                		tmp = z + x;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	tmp = 0
                	if x <= -4.9e-150:
                		tmp = z + x
                	elif x <= 1.22e-154:
                		tmp = z + y
                	else:
                		tmp = z + x
                	return tmp
                
                function code(x, y, z)
                	tmp = 0.0
                	if (x <= -4.9e-150)
                		tmp = Float64(z + x);
                	elseif (x <= 1.22e-154)
                		tmp = Float64(z + y);
                	else
                		tmp = Float64(z + x);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	tmp = 0.0;
                	if (x <= -4.9e-150)
                		tmp = z + x;
                	elseif (x <= 1.22e-154)
                		tmp = z + y;
                	else
                		tmp = z + x;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := If[LessEqual[x, -4.9e-150], N[(z + x), $MachinePrecision], If[LessEqual[x, 1.22e-154], N[(z + y), $MachinePrecision], N[(z + x), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x \leq -4.9 \cdot 10^{-150}:\\
                \;\;\;\;z + x\\
                
                \mathbf{elif}\;x \leq 1.22 \cdot 10^{-154}:\\
                \;\;\;\;z + y\\
                
                \mathbf{else}:\\
                \;\;\;\;z + x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x < -4.8999999999999995e-150 or 1.22000000000000005e-154 < x

                  1. Initial program 99.9%

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

                    \[\leadsto \color{blue}{x + z} \]
                  3. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto z + \color{blue}{x} \]
                    2. lower-+.f6466.2

                      \[\leadsto z + \color{blue}{x} \]
                  4. Applied rewrites66.2%

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

                  if -4.8999999999999995e-150 < x < 1.22000000000000005e-154

                  1. Initial program 99.9%

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

                    \[\leadsto \color{blue}{\sin y + z \cdot \cos y} \]
                  3. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto z \cdot \cos y + \color{blue}{\sin y} \]
                    2. *-commutativeN/A

                      \[\leadsto \cos y \cdot z + \sin \color{blue}{y} \]
                    3. lower-fma.f64N/A

                      \[\leadsto \mathsf{fma}\left(\cos y, \color{blue}{z}, \sin y\right) \]
                    4. lift-cos.f64N/A

                      \[\leadsto \mathsf{fma}\left(\cos y, z, \sin y\right) \]
                    5. lift-sin.f6458.7

                      \[\leadsto \mathsf{fma}\left(\cos y, z, \sin y\right) \]
                  4. Applied rewrites58.7%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, z, \sin y\right)} \]
                  5. Taylor expanded in y around 0

                    \[\leadsto y + \color{blue}{z} \]
                  6. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto z + y \]
                    2. lower-+.f6429.5

                      \[\leadsto z + y \]
                  7. Applied rewrites29.5%

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

                Alternative 16: 50.7% accurate, 6.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{+50}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+50}:\\ \;\;\;\;z + y\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= x -1.75e+50) (+ y x) (if (<= x 1.45e+50) (+ z y) (+ y x))))
                double code(double x, double y, double z) {
                	double tmp;
                	if (x <= -1.75e+50) {
                		tmp = y + x;
                	} else if (x <= 1.45e+50) {
                		tmp = z + y;
                	} else {
                		tmp = y + x;
                	}
                	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)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8) :: tmp
                    if (x <= (-1.75d+50)) then
                        tmp = y + x
                    else if (x <= 1.45d+50) then
                        tmp = z + y
                    else
                        tmp = y + x
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double tmp;
                	if (x <= -1.75e+50) {
                		tmp = y + x;
                	} else if (x <= 1.45e+50) {
                		tmp = z + y;
                	} else {
                		tmp = y + x;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	tmp = 0
                	if x <= -1.75e+50:
                		tmp = y + x
                	elif x <= 1.45e+50:
                		tmp = z + y
                	else:
                		tmp = y + x
                	return tmp
                
                function code(x, y, z)
                	tmp = 0.0
                	if (x <= -1.75e+50)
                		tmp = Float64(y + x);
                	elseif (x <= 1.45e+50)
                		tmp = Float64(z + y);
                	else
                		tmp = Float64(y + x);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	tmp = 0.0;
                	if (x <= -1.75e+50)
                		tmp = y + x;
                	elseif (x <= 1.45e+50)
                		tmp = z + y;
                	else
                		tmp = y + x;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := If[LessEqual[x, -1.75e+50], N[(y + x), $MachinePrecision], If[LessEqual[x, 1.45e+50], N[(z + y), $MachinePrecision], N[(y + x), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x \leq -1.75 \cdot 10^{+50}:\\
                \;\;\;\;y + x\\
                
                \mathbf{elif}\;x \leq 1.45 \cdot 10^{+50}:\\
                \;\;\;\;z + y\\
                
                \mathbf{else}:\\
                \;\;\;\;y + x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x < -1.75000000000000003e50 or 1.45e50 < x

                  1. Initial program 99.9%

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

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

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

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

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

                      \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
                    6. +-commutativeN/A

                      \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
                    7. *-commutativeN/A

                      \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
                    8. lower-fma.f64N/A

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

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
                    10. +-commutativeN/A

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

                      \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
                    12. lift-sin.f6499.9

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

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

                    \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
                  5. Step-by-step derivation
                    1. distribute-lft-inN/A

                      \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
                    2. *-rgt-identityN/A

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

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

                      \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
                    5. div-add-revN/A

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

                      \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
                    7. +-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                    9. lift-sin.f64N/A

                      \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                    10. lift-fma.f64N/A

                      \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
                    11. lift-cos.f6488.1

                      \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
                  6. Applied rewrites88.1%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
                  7. Taylor expanded in z around 0

                    \[\leadsto \color{blue}{x + \sin y} \]
                  8. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \sin y + \color{blue}{x} \]
                    2. lower-+.f64N/A

                      \[\leadsto \sin y + \color{blue}{x} \]
                    3. lift-sin.f6458.5

                      \[\leadsto \sin y + x \]
                  9. Applied rewrites58.5%

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

                    \[\leadsto y + x \]
                  11. Step-by-step derivation
                    1. Applied rewrites38.6%

                      \[\leadsto y + x \]

                    if -1.75000000000000003e50 < x < 1.45e50

                    1. Initial program 99.9%

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

                      \[\leadsto \color{blue}{\sin y + z \cdot \cos y} \]
                    3. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto z \cdot \cos y + \color{blue}{\sin y} \]
                      2. *-commutativeN/A

                        \[\leadsto \cos y \cdot z + \sin \color{blue}{y} \]
                      3. lower-fma.f64N/A

                        \[\leadsto \mathsf{fma}\left(\cos y, \color{blue}{z}, \sin y\right) \]
                      4. lift-cos.f64N/A

                        \[\leadsto \mathsf{fma}\left(\cos y, z, \sin y\right) \]
                      5. lift-sin.f6458.7

                        \[\leadsto \mathsf{fma}\left(\cos y, z, \sin y\right) \]
                    4. Applied rewrites58.7%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, z, \sin y\right)} \]
                    5. Taylor expanded in y around 0

                      \[\leadsto y + \color{blue}{z} \]
                    6. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto z + y \]
                      2. lower-+.f6429.5

                        \[\leadsto z + y \]
                    7. Applied rewrites29.5%

                      \[\leadsto z + \color{blue}{y} \]
                  12. Recombined 2 regimes into one program.
                  13. Add Preprocessing

                  Alternative 17: 46.9% accurate, 6.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+163}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+137}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \end{array} \]
                  (FPCore (x y z)
                   :precision binary64
                   (if (<= z -3.2e+163) z (if (<= z 3.8e+137) (+ y x) z)))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if (z <= -3.2e+163) {
                  		tmp = z;
                  	} else if (z <= 3.8e+137) {
                  		tmp = y + x;
                  	} else {
                  		tmp = z;
                  	}
                  	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)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8) :: tmp
                      if (z <= (-3.2d+163)) then
                          tmp = z
                      else if (z <= 3.8d+137) then
                          tmp = y + x
                      else
                          tmp = z
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	double tmp;
                  	if (z <= -3.2e+163) {
                  		tmp = z;
                  	} else if (z <= 3.8e+137) {
                  		tmp = y + x;
                  	} else {
                  		tmp = z;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z):
                  	tmp = 0
                  	if z <= -3.2e+163:
                  		tmp = z
                  	elif z <= 3.8e+137:
                  		tmp = y + x
                  	else:
                  		tmp = z
                  	return tmp
                  
                  function code(x, y, z)
                  	tmp = 0.0
                  	if (z <= -3.2e+163)
                  		tmp = z;
                  	elseif (z <= 3.8e+137)
                  		tmp = Float64(y + x);
                  	else
                  		tmp = z;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z)
                  	tmp = 0.0;
                  	if (z <= -3.2e+163)
                  		tmp = z;
                  	elseif (z <= 3.8e+137)
                  		tmp = y + x;
                  	else
                  		tmp = z;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_] := If[LessEqual[z, -3.2e+163], z, If[LessEqual[z, 3.8e+137], N[(y + x), $MachinePrecision], z]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -3.2 \cdot 10^{+163}:\\
                  \;\;\;\;z\\
                  
                  \mathbf{elif}\;z \leq 3.8 \cdot 10^{+137}:\\
                  \;\;\;\;y + x\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;z\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -3.1999999999999998e163 or 3.79999999999999963e137 < z

                    1. Initial program 99.9%

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

                      \[\leadsto \color{blue}{x + z} \]
                    3. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto z + \color{blue}{x} \]
                      2. lower-+.f6466.2

                        \[\leadsto z + \color{blue}{x} \]
                    4. Applied rewrites66.2%

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

                      \[\leadsto z \]
                    6. Step-by-step derivation
                      1. Applied rewrites26.1%

                        \[\leadsto z \]

                      if -3.1999999999999998e163 < z < 3.79999999999999963e137

                      1. Initial program 99.9%

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

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

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

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

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

                          \[\leadsto \left(x + \sin y\right) + z \cdot \color{blue}{\cos y} \]
                        6. +-commutativeN/A

                          \[\leadsto \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]
                        7. *-commutativeN/A

                          \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
                        8. lower-fma.f64N/A

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

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, x + \sin y\right) \]
                        10. +-commutativeN/A

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

                          \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
                        12. lift-sin.f6499.9

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

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

                        \[\leadsto \color{blue}{x \cdot \left(1 + \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)\right)} \]
                      5. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}\right)} \]
                        2. *-rgt-identityN/A

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

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

                          \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x} + \frac{z \cdot \cos y}{x}}, x\right) \]
                        5. div-add-revN/A

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

                          \[\leadsto \mathsf{fma}\left(x, \frac{\sin y + z \cdot \cos y}{\color{blue}{x}}, x\right) \]
                        7. +-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(x, \frac{z \cdot \cos y + \sin y}{x}, x\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                        9. lift-sin.f64N/A

                          \[\leadsto \mathsf{fma}\left(x, \frac{\cos y \cdot z + \sin y}{x}, x\right) \]
                        10. lift-fma.f64N/A

                          \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
                        11. lift-cos.f6488.1

                          \[\leadsto \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right) \]
                      6. Applied rewrites88.1%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{\mathsf{fma}\left(\cos y, z, \sin y\right)}{x}, x\right)} \]
                      7. Taylor expanded in z around 0

                        \[\leadsto \color{blue}{x + \sin y} \]
                      8. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \sin y + \color{blue}{x} \]
                        2. lower-+.f64N/A

                          \[\leadsto \sin y + \color{blue}{x} \]
                        3. lift-sin.f6458.5

                          \[\leadsto \sin y + x \]
                      9. Applied rewrites58.5%

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

                        \[\leadsto y + x \]
                      11. Step-by-step derivation
                        1. Applied rewrites38.6%

                          \[\leadsto y + x \]
                      12. Recombined 2 regimes into one program.
                      13. Add Preprocessing

                      Alternative 18: 26.1% accurate, 73.1× speedup?

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

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

                        \[\leadsto \color{blue}{x + z} \]
                      3. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto z + \color{blue}{x} \]
                        2. lower-+.f6466.2

                          \[\leadsto z + \color{blue}{x} \]
                      4. Applied rewrites66.2%

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

                        \[\leadsto z \]
                      6. Step-by-step derivation
                        1. Applied rewrites26.1%

                          \[\leadsto z \]
                        2. Add Preprocessing

                        Reproduce

                        ?
                        herbie shell --seed 2025136 
                        (FPCore (x y z)
                          :name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
                          :precision binary64
                          (+ (+ x (sin y)) (* z (cos y))))