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

Percentage Accurate: 99.9% → 99.9%
Time: 8.7s
Alternatives: 11
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}

Sampling outcomes in binary64 precision:

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 11 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. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 2: 81.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(1, z, \sin y\right)\\ t_1 := \left(x + \sin y\right) + z \cdot \cos y\\ \mathbf{if}\;t\_1 \leq -5:\\ \;\;\;\;z + x\\ \mathbf{elif}\;t\_1 \leq -0.05:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-34}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right)\\ \mathbf{elif}\;t\_1 \leq 2000000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (fma 1.0 z (sin y))) (t_1 (+ (+ x (sin y)) (* z (cos y)))))
   (if (<= t_1 -5.0)
     (+ z x)
     (if (<= t_1 -0.05)
       t_0
       (if (<= t_1 5e-34)
         (fma (fma (* -0.16666666666666666 y) y 1.0) y (+ z x))
         (if (<= t_1 2000000.0) t_0 (+ z x)))))))
double code(double x, double y, double z) {
	double t_0 = fma(1.0, z, sin(y));
	double t_1 = (x + sin(y)) + (z * cos(y));
	double tmp;
	if (t_1 <= -5.0) {
		tmp = z + x;
	} else if (t_1 <= -0.05) {
		tmp = t_0;
	} else if (t_1 <= 5e-34) {
		tmp = fma(fma((-0.16666666666666666 * y), y, 1.0), y, (z + x));
	} else if (t_1 <= 2000000.0) {
		tmp = t_0;
	} else {
		tmp = z + x;
	}
	return tmp;
}
function code(x, y, z)
	t_0 = fma(1.0, z, sin(y))
	t_1 = Float64(Float64(x + sin(y)) + Float64(z * cos(y)))
	tmp = 0.0
	if (t_1 <= -5.0)
		tmp = Float64(z + x);
	elseif (t_1 <= -0.05)
		tmp = t_0;
	elseif (t_1 <= 5e-34)
		tmp = fma(fma(Float64(-0.16666666666666666 * y), y, 1.0), y, Float64(z + x));
	elseif (t_1 <= 2000000.0)
		tmp = t_0;
	else
		tmp = Float64(z + x);
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 * z + N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5.0], N[(z + x), $MachinePrecision], If[LessEqual[t$95$1, -0.05], t$95$0, If[LessEqual[t$95$1, 5e-34], N[(N[(N[(-0.16666666666666666 * y), $MachinePrecision] * y + 1.0), $MachinePrecision] * y + N[(z + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2000000.0], t$95$0, N[(z + x), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(1, z, \sin y\right)\\
t_1 := \left(x + \sin y\right) + z \cdot \cos y\\
\mathbf{if}\;t\_1 \leq -5:\\
\;\;\;\;z + x\\

\mathbf{elif}\;t\_1 \leq -0.05:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;t\_1 \leq 2000000:\\
\;\;\;\;t\_0\\

\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))) < -5 or 2e6 < (+.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. Add Preprocessing
    3. Taylor expanded in y around 0

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

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

        \[\leadsto \color{blue}{z + x} \]
    5. Applied rewrites77.8%

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

    if -5 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -0.050000000000000003 or 5.0000000000000003e-34 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 2e6

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y}\right) \]
    6. Step-by-step derivation
      1. lower-sin.f6498.9

        \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y}\right) \]
    7. Applied rewrites98.9%

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \sin y\right) \]
    9. Step-by-step derivation
      1. Applied rewrites93.7%

        \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \sin y\right) \]

      if -0.050000000000000003 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 5.0000000000000003e-34

      1. Initial program 100.0%

        \[\left(x + \sin y\right) + z \cdot \cos y \]
      2. Add Preprocessing
      3. 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)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(1 + y \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right), y, x + z\right)} \]
        7. fp-cancel-sign-sub-invN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{1 - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right)}, y, x + z\right) \]
        8. fp-cancel-sub-sign-invN/A

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right) + 1}, y, x + z\right) \]
        10. remove-double-negN/A

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{6}, y, \color{blue}{\frac{-1}{2} \cdot z}\right), y, 1\right), y, x + z\right) \]
        16. +-commutativeN/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, \color{blue}{z + x}\right) \]
        17. lower-+.f64100.0

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, \color{blue}{z + x}\right) \]
      5. Applied rewrites100.0%

        \[\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 + x\right)} \]
      6. Taylor expanded in y around inf

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{6} \cdot y, y, 1\right), y, z + x\right) \]
      7. Step-by-step derivation
        1. Applied rewrites100.0%

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right) \]
      8. Recombined 3 regimes into one program.
      9. Final simplification82.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x + \sin y\right) + z \cdot \cos y \leq -5:\\ \;\;\;\;z + x\\ \mathbf{elif}\;\left(x + \sin y\right) + z \cdot \cos y \leq -0.05:\\ \;\;\;\;\mathsf{fma}\left(1, z, \sin y\right)\\ \mathbf{elif}\;\left(x + \sin y\right) + z \cdot \cos y \leq 5 \cdot 10^{-34}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right)\\ \mathbf{elif}\;\left(x + \sin y\right) + z \cdot \cos y \leq 2000000:\\ \;\;\;\;\mathsf{fma}\left(1, z, \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
      10. Add Preprocessing

      Alternative 3: 70.4% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + \sin y\right) + z \cdot \cos y\\ \mathbf{if}\;t\_0 \leq -0.05 \lor \neg \left(t\_0 \leq 2 \cdot 10^{-30}\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\left(z + y\right) + x\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (+ (+ x (sin y)) (* z (cos y)))))
         (if (or (<= t_0 -0.05) (not (<= t_0 2e-30))) (+ z x) (+ (+ z y) x))))
      double code(double x, double y, double z) {
      	double t_0 = (x + sin(y)) + (z * cos(y));
      	double tmp;
      	if ((t_0 <= -0.05) || !(t_0 <= 2e-30)) {
      		tmp = z + x;
      	} else {
      		tmp = (z + 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) :: t_0
          real(8) :: tmp
          t_0 = (x + sin(y)) + (z * cos(y))
          if ((t_0 <= (-0.05d0)) .or. (.not. (t_0 <= 2d-30))) then
              tmp = z + x
          else
              tmp = (z + y) + x
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = (x + Math.sin(y)) + (z * Math.cos(y));
      	double tmp;
      	if ((t_0 <= -0.05) || !(t_0 <= 2e-30)) {
      		tmp = z + x;
      	} else {
      		tmp = (z + y) + x;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = (x + math.sin(y)) + (z * math.cos(y))
      	tmp = 0
      	if (t_0 <= -0.05) or not (t_0 <= 2e-30):
      		tmp = z + x
      	else:
      		tmp = (z + y) + 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 <= -0.05) || !(t_0 <= 2e-30))
      		tmp = Float64(z + x);
      	else
      		tmp = Float64(Float64(z + y) + x);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = (x + sin(y)) + (z * cos(y));
      	tmp = 0.0;
      	if ((t_0 <= -0.05) || ~((t_0 <= 2e-30)))
      		tmp = z + x;
      	else
      		tmp = (z + y) + x;
      	end
      	tmp_2 = 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[Or[LessEqual[t$95$0, -0.05], N[Not[LessEqual[t$95$0, 2e-30]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(N[(z + y), $MachinePrecision] + x), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \left(x + \sin y\right) + z \cdot \cos y\\
      \mathbf{if}\;t\_0 \leq -0.05 \lor \neg \left(t\_0 \leq 2 \cdot 10^{-30}\right):\\
      \;\;\;\;z + x\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(z + y\right) + x\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -0.050000000000000003 or 2e-30 < (+.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. Add Preprocessing
        3. Taylor expanded in y around 0

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

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

            \[\leadsto \color{blue}{z + x} \]
        5. Applied rewrites68.2%

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

        if -0.050000000000000003 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 2e-30

        1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x + \sin y\right) + z \cdot \cos y \leq -0.05 \lor \neg \left(\left(x + \sin y\right) + z \cdot \cos y \leq 2 \cdot 10^{-30}\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\left(z + y\right) + x\\ \end{array} \]
      5. Add Preprocessing

      Alternative 4: 89.1% accurate, 1.0× speedup?

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

        1. Initial program 100.0%

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

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

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

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

            \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
          5. lower-fma.f64100.0

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

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

            \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
          8. lower-+.f64100.0

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

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

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

            \[\leadsto \mathsf{fma}\left(\cos y, z, x \cdot \color{blue}{\left(\frac{\sin y}{x} + 1\right)}\right) \]
          2. distribute-rgt-inN/A

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

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

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

            \[\leadsto \mathsf{fma}\left(\cos y, z, \mathsf{fma}\left(\color{blue}{\frac{\sin y}{x}}, x, x\right)\right) \]
          6. lower-sin.f64100.0

            \[\leadsto \mathsf{fma}\left(\cos y, z, \mathsf{fma}\left(\frac{\color{blue}{\sin y}}{x}, x, x\right)\right) \]
        7. Applied rewrites100.0%

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \mathsf{fma}\left(\frac{\sin y}{x}, x, x\right)\right) \]
        9. Step-by-step derivation
          1. Applied rewrites88.3%

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

          if -6.1999999999999995e-66 < x < 1.8e-127

          1. Initial program 99.9%

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\cos y}, z, \sin y\right) \]
            5. lower-sin.f6499.9

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

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

          if 1.8e-127 < x

          1. Initial program 99.9%

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

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

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

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

              \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
            5. lower-fma.f64100.0

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

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

              \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
            8. lower-+.f64100.0

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \sin y + x\right) \]
          6. Step-by-step derivation
            1. Applied rewrites86.7%

              \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \sin y + x\right) \]
          7. Recombined 3 regimes into one program.
          8. Final simplification91.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{-66}:\\ \;\;\;\;\mathsf{fma}\left(1, z, \mathsf{fma}\left(\frac{\sin y}{x}, x, x\right)\right)\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-127}:\\ \;\;\;\;\mathsf{fma}\left(\cos y, z, \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1, z, \sin y + x\right)\\ \end{array} \]
          9. Add Preprocessing

          Alternative 5: 69.7% accurate, 1.7× speedup?

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

            1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\cos y, z, x \cdot \color{blue}{\left(\frac{\sin y}{x} + 1\right)}\right) \]
              2. distribute-rgt-inN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\cos y, z, \mathsf{fma}\left(\color{blue}{\frac{\sin y}{x}}, x, x\right)\right) \]
              6. lower-sin.f6499.8

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

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

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

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

                \[\leadsto \color{blue}{\cos y \cdot z} \]
              3. lower-cos.f6450.9

                \[\leadsto \color{blue}{\cos y} \cdot z \]
            10. Applied rewrites50.9%

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

            if -9.5000000000000001e204 < y < -6.3999999999999998e36

            1. Initial program 99.9%

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

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

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

                \[\leadsto \color{blue}{z + x} \]
            5. Applied rewrites57.9%

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

            if -6.3999999999999998e36 < y < 7.19999999999999972e50

            1. Initial program 100.0%

              \[\left(x + \sin y\right) + z \cdot \cos y \]
            2. Add Preprocessing
            3. 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)} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(1 + y \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right), y, x + z\right)} \]
              7. fp-cancel-sign-sub-invN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{1 - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right)}, y, x + z\right) \]
              8. fp-cancel-sub-sign-invN/A

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right) + 1}, y, x + z\right) \]
              10. remove-double-negN/A

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{6}, y, \color{blue}{\frac{-1}{2} \cdot z}\right), y, 1\right), y, x + z\right) \]
              16. +-commutativeN/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, \color{blue}{z + x}\right) \]
              17. lower-+.f6494.9

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, \color{blue}{z + x}\right) \]
            5. Applied rewrites94.9%

              \[\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 + x\right)} \]
            6. Taylor expanded in y around inf

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{6} \cdot y, y, 1\right), y, z + x\right) \]
            7. Step-by-step derivation
              1. Applied rewrites96.1%

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right) \]
            8. Recombined 3 regimes into one program.
            9. Final simplification78.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+204}:\\ \;\;\;\;\cos y \cdot z\\ \mathbf{elif}\;y \leq -6.4 \cdot 10^{+36}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+50}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right)\\ \mathbf{else}:\\ \;\;\;\;\cos y \cdot z\\ \end{array} \]
            10. Add Preprocessing

            Alternative 6: 89.1% accurate, 1.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+152} \lor \neg \left(z \leq 3 \cdot 10^{+73}\right):\\ \;\;\;\;\cos y \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1, z, \sin y + x\right)\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= z -2e+152) (not (<= z 3e+73)))
               (* (cos y) z)
               (fma 1.0 z (+ (sin y) x))))
            double code(double x, double y, double z) {
            	double tmp;
            	if ((z <= -2e+152) || !(z <= 3e+73)) {
            		tmp = cos(y) * z;
            	} else {
            		tmp = fma(1.0, z, (sin(y) + x));
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((z <= -2e+152) || !(z <= 3e+73))
            		tmp = Float64(cos(y) * z);
            	else
            		tmp = fma(1.0, z, Float64(sin(y) + x));
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[z, -2e+152], N[Not[LessEqual[z, 3e+73]], $MachinePrecision]], N[(N[Cos[y], $MachinePrecision] * z), $MachinePrecision], N[(1.0 * z + N[(N[Sin[y], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -2 \cdot 10^{+152} \lor \neg \left(z \leq 3 \cdot 10^{+73}\right):\\
            \;\;\;\;\cos y \cdot z\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(1, z, \sin y + x\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -2.0000000000000001e152 or 3.00000000000000011e73 < z

              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\cos y, z, x \cdot \color{blue}{\left(\frac{\sin y}{x} + 1\right)}\right) \]
                2. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\cos y \cdot z} \]
                3. lower-cos.f6485.7

                  \[\leadsto \color{blue}{\cos y} \cdot z \]
              10. Applied rewrites85.7%

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

              if -2.0000000000000001e152 < z < 3.00000000000000011e73

              1. Initial program 100.0%

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

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

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

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

                  \[\leadsto \color{blue}{\cos y \cdot z} + \left(x + \sin y\right) \]
                5. lower-fma.f64100.0

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

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

                  \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{\sin y + x}\right) \]
                8. lower-+.f64100.0

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \sin y + x\right) \]
              6. Step-by-step derivation
                1. Applied rewrites94.1%

                  \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \sin y + x\right) \]
              7. Recombined 2 regimes into one program.
              8. Final simplification91.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+152} \lor \neg \left(z \leq 3 \cdot 10^{+73}\right):\\ \;\;\;\;\cos y \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1, z, \sin y + x\right)\\ \end{array} \]
              9. Add Preprocessing

              Alternative 7: 70.7% accurate, 6.4× speedup?

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

                1. Initial program 99.8%

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

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

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

                    \[\leadsto \color{blue}{z + x} \]
                5. Applied rewrites46.6%

                  \[\leadsto \color{blue}{z + x} \]
                6. Step-by-step derivation
                  1. Applied rewrites19.5%

                    \[\leadsto \mathsf{fma}\left(\sqrt{x}, \color{blue}{\sqrt{x}}, z\right) \]
                  2. Taylor expanded in x around inf

                    \[\leadsto x \cdot \color{blue}{\left(1 + \frac{z}{x}\right)} \]
                  3. Step-by-step derivation
                    1. Applied rewrites45.0%

                      \[\leadsto \mathsf{fma}\left(\frac{z}{x}, \color{blue}{x}, x\right) \]
                    2. Step-by-step derivation
                      1. Applied rewrites48.2%

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

                      if -5.50000000000000001e42 < y < 8.2e18

                      1. Initial program 100.0%

                        \[\left(x + \sin y\right) + z \cdot \cos y \]
                      2. Add Preprocessing
                      3. 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)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

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

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(1 + y \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right), y, x + z\right)} \]
                        7. fp-cancel-sign-sub-invN/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{1 - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right)}, y, x + z\right) \]
                        8. fp-cancel-sub-sign-invN/A

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

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y\right)\right)\right)\right) \cdot \left(\frac{-1}{2} \cdot z + \frac{-1}{6} \cdot y\right) + 1}, y, x + z\right) \]
                        10. remove-double-negN/A

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{6}, y, \color{blue}{\frac{-1}{2} \cdot z}\right), y, 1\right), y, x + z\right) \]
                        16. +-commutativeN/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, \color{blue}{z + x}\right) \]
                        17. lower-+.f6496.1

                          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, \color{blue}{z + x}\right) \]
                      5. Applied rewrites96.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 + x\right)} \]
                      6. Taylor expanded in y around inf

                        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{6} \cdot y, y, 1\right), y, z + x\right) \]
                      7. Step-by-step derivation
                        1. Applied rewrites96.6%

                          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right) \]

                        if 8.2e18 < y

                        1. Initial program 99.9%

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

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

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

                            \[\leadsto \color{blue}{z + x} \]
                        5. Applied rewrites30.7%

                          \[\leadsto \color{blue}{z + x} \]
                      8. Recombined 3 regimes into one program.
                      9. Final simplification72.4%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+42}:\\ \;\;\;\;x - z\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+18}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right)\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 8: 70.8% accurate, 11.1× speedup?

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

                        1. Initial program 99.8%

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

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

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

                            \[\leadsto \color{blue}{z + x} \]
                        5. Applied rewrites45.7%

                          \[\leadsto \color{blue}{z + x} \]
                        6. Step-by-step derivation
                          1. Applied rewrites19.2%

                            \[\leadsto \mathsf{fma}\left(\sqrt{x}, \color{blue}{\sqrt{x}}, z\right) \]
                          2. Taylor expanded in x around inf

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

                              \[\leadsto \mathsf{fma}\left(\frac{z}{x}, \color{blue}{x}, x\right) \]
                            2. Step-by-step derivation
                              1. Applied rewrites47.2%

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

                              if -8.00000000000000034e36 < y < 1.29999999999999989e-4

                              1. Initial program 100.0%

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

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

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

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

                                  \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                                4. lower-+.f6498.0

                                  \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                              5. Applied rewrites98.0%

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

                              if 1.29999999999999989e-4 < y

                              1. Initial program 99.9%

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

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

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

                                  \[\leadsto \color{blue}{z + x} \]
                              5. Applied rewrites32.5%

                                \[\leadsto \color{blue}{z + x} \]
                            3. Recombined 3 regimes into one program.
                            4. Final simplification72.3%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+36}:\\ \;\;\;\;x - z\\ \mathbf{elif}\;y \leq 0.00013:\\ \;\;\;\;\left(z + y\right) + x\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 9: 67.1% accurate, 13.2× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.4 \cdot 10^{-34} \lor \neg \left(x \leq 1.2 \cdot 10^{-46}\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;z + y\\ \end{array} \end{array} \]
                            (FPCore (x y z)
                             :precision binary64
                             (if (or (<= x -4.4e-34) (not (<= x 1.2e-46))) (+ z x) (+ z y)))
                            double code(double x, double y, double z) {
                            	double tmp;
                            	if ((x <= -4.4e-34) || !(x <= 1.2e-46)) {
                            		tmp = z + x;
                            	} else {
                            		tmp = z + y;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y, z)
                            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.4d-34)) .or. (.not. (x <= 1.2d-46))) then
                                    tmp = z + x
                                else
                                    tmp = z + y
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z) {
                            	double tmp;
                            	if ((x <= -4.4e-34) || !(x <= 1.2e-46)) {
                            		tmp = z + x;
                            	} else {
                            		tmp = z + y;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z):
                            	tmp = 0
                            	if (x <= -4.4e-34) or not (x <= 1.2e-46):
                            		tmp = z + x
                            	else:
                            		tmp = z + y
                            	return tmp
                            
                            function code(x, y, z)
                            	tmp = 0.0
                            	if ((x <= -4.4e-34) || !(x <= 1.2e-46))
                            		tmp = Float64(z + x);
                            	else
                            		tmp = Float64(z + y);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z)
                            	tmp = 0.0;
                            	if ((x <= -4.4e-34) || ~((x <= 1.2e-46)))
                            		tmp = z + x;
                            	else
                            		tmp = z + y;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_] := If[Or[LessEqual[x, -4.4e-34], N[Not[LessEqual[x, 1.2e-46]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(z + y), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;x \leq -4.4 \cdot 10^{-34} \lor \neg \left(x \leq 1.2 \cdot 10^{-46}\right):\\
                            \;\;\;\;z + x\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;z + y\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if x < -4.3999999999999998e-34 or 1.20000000000000007e-46 < x

                              1. Initial program 100.0%

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

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

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

                                  \[\leadsto \color{blue}{z + x} \]
                              5. Applied rewrites83.4%

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

                              if -4.3999999999999998e-34 < x < 1.20000000000000007e-46

                              1. Initial program 99.9%

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

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

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

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

                                  \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                                4. lower-+.f6454.3

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

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

                                \[\leadsto y + \color{blue}{z} \]
                              7. Step-by-step derivation
                                1. Applied rewrites50.1%

                                  \[\leadsto z + \color{blue}{y} \]
                              8. Recombined 2 regimes into one program.
                              9. Final simplification69.1%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.4 \cdot 10^{-34} \lor \neg \left(x \leq 1.2 \cdot 10^{-46}\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;z + y\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 10: 58.4% accurate, 13.2× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-16} \lor \neg \left(x \leq 1.25 \cdot 10^{+34}\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z + y\\ \end{array} \end{array} \]
                              (FPCore (x y z)
                               :precision binary64
                               (if (or (<= x -5.5e-16) (not (<= x 1.25e+34))) x (+ z y)))
                              double code(double x, double y, double z) {
                              	double tmp;
                              	if ((x <= -5.5e-16) || !(x <= 1.25e+34)) {
                              		tmp = x;
                              	} else {
                              		tmp = z + y;
                              	}
                              	return tmp;
                              }
                              
                              module fmin_fmax_functions
                                  implicit none
                                  private
                                  public fmax
                                  public fmin
                              
                                  interface fmax
                                      module procedure fmax88
                                      module procedure fmax44
                                      module procedure fmax84
                                      module procedure fmax48
                                  end interface
                                  interface fmin
                                      module procedure fmin88
                                      module procedure fmin44
                                      module procedure fmin84
                                      module procedure fmin48
                                  end interface
                              contains
                                  real(8) function fmax88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmax44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmax84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmax48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmin44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmin48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                  end function
                              end module
                              
                              real(8) function code(x, y, z)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  real(8), intent (in) :: z
                                  real(8) :: tmp
                                  if ((x <= (-5.5d-16)) .or. (.not. (x <= 1.25d+34))) then
                                      tmp = x
                                  else
                                      tmp = z + y
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double x, double y, double z) {
                              	double tmp;
                              	if ((x <= -5.5e-16) || !(x <= 1.25e+34)) {
                              		tmp = x;
                              	} else {
                              		tmp = z + y;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z):
                              	tmp = 0
                              	if (x <= -5.5e-16) or not (x <= 1.25e+34):
                              		tmp = x
                              	else:
                              		tmp = z + y
                              	return tmp
                              
                              function code(x, y, z)
                              	tmp = 0.0
                              	if ((x <= -5.5e-16) || !(x <= 1.25e+34))
                              		tmp = x;
                              	else
                              		tmp = Float64(z + y);
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, y, z)
                              	tmp = 0.0;
                              	if ((x <= -5.5e-16) || ~((x <= 1.25e+34)))
                              		tmp = x;
                              	else
                              		tmp = z + y;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_, z_] := If[Or[LessEqual[x, -5.5e-16], N[Not[LessEqual[x, 1.25e+34]], $MachinePrecision]], x, N[(z + y), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;x \leq -5.5 \cdot 10^{-16} \lor \neg \left(x \leq 1.25 \cdot 10^{+34}\right):\\
                              \;\;\;\;x\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;z + y\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if x < -5.49999999999999964e-16 or 1.25e34 < x

                                1. Initial program 100.0%

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

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

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

                                    \[\leadsto \color{blue}{z + x} \]
                                5. Applied rewrites87.0%

                                  \[\leadsto \color{blue}{z + x} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites35.8%

                                    \[\leadsto \mathsf{fma}\left(\sqrt{x}, \color{blue}{\sqrt{x}}, z\right) \]
                                  2. Taylor expanded in x around -inf

                                    \[\leadsto -1 \cdot \color{blue}{\left(x \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites74.7%

                                      \[\leadsto x \]

                                    if -5.49999999999999964e-16 < x < 1.25e34

                                    1. Initial program 99.9%

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

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

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

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

                                        \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                                      4. lower-+.f6456.3

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

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

                                      \[\leadsto y + \color{blue}{z} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites49.4%

                                        \[\leadsto z + \color{blue}{y} \]
                                    8. Recombined 2 regimes into one program.
                                    9. Final simplification61.7%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-16} \lor \neg \left(x \leq 1.25 \cdot 10^{+34}\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z + y\\ \end{array} \]
                                    10. Add Preprocessing

                                    Alternative 11: 43.1% accurate, 212.0× speedup?

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

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

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

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

                                        \[\leadsto \color{blue}{z + x} \]
                                    5. Applied rewrites65.3%

                                      \[\leadsto \color{blue}{z + x} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites30.4%

                                        \[\leadsto \mathsf{fma}\left(\sqrt{x}, \color{blue}{\sqrt{x}}, z\right) \]
                                      2. Taylor expanded in x around -inf

                                        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites40.2%

                                          \[\leadsto x \]
                                        2. Final simplification40.2%

                                          \[\leadsto x \]
                                        3. Add Preprocessing

                                        Reproduce

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