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

Percentage Accurate: 99.9% → 99.9%
Time: 4.8s
Alternatives: 14
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(x + \sin y\right) + z \cdot \cos y \end{array} \]
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
	return (x + sin(y)) + (z * cos(y));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
	return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z):
	return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z)
	return Float64(Float64(x + sin(y)) + Float64(z * cos(y)))
end
function tmp = code(x, y, z)
	tmp = (x + sin(y)) + (z * cos(y));
end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 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\right) + x \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 Float64(fma(cos(y), z, sin(y)) + x)
end
code[x_, y_, z_] := N[(N[(N[Cos[y], $MachinePrecision] * z + N[Sin[y], $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+75}:\\ \;\;\;\;\left(x + y\right) + z \cdot \cos y\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+75}:\\ \;\;\;\;\left(\sin y + x\right) + z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\cos y, z, \sin y\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -1.85e+75)
   (+ (+ x y) (* z (cos y)))
   (if (<= z 5.5e+75) (+ (+ (sin y) x) z) (fma (cos y) z (sin y)))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.85e+75) {
		tmp = (x + y) + (z * cos(y));
	} else if (z <= 5.5e+75) {
		tmp = (sin(y) + x) + z;
	} else {
		tmp = fma(cos(y), z, sin(y));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -1.85e+75)
		tmp = Float64(Float64(x + y) + Float64(z * cos(y)));
	elseif (z <= 5.5e+75)
		tmp = Float64(Float64(sin(y) + x) + z);
	else
		tmp = fma(cos(y), z, sin(y));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -1.85e+75], N[(N[(x + y), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e+75], N[(N[(N[Sin[y], $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] * z + N[Sin[y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+75}:\\
\;\;\;\;\left(x + y\right) + z \cdot \cos y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.85000000000000005e75

    1. Initial program 99.9%

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

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

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

      if -1.85000000000000005e75 < z < 5.5000000000000001e75

      1. Initial program 99.9%

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(\sin y + x\right)} + z \]
          5. lift-sin.f6483.0

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

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

        if 5.5000000000000001e75 < z

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

      Alternative 4: 89.9% accurate, 1.5× speedup?

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

        1. Initial program 99.9%

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

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

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

          if -1.85000000000000005e75 < z < 6.6000000000000003e140

          1. Initial program 99.9%

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left(\sin y + x\right)} + z \]
              5. lift-sin.f6483.0

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

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

            if 6.6000000000000003e140 < z

            1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 5: 89.8% accurate, 1.5× speedup?

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

            1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -1.85000000000000005e75 < z < 6.6000000000000003e140

            1. Initial program 99.9%

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\sin y + x\right)} + z \]
                5. lift-sin.f6483.0

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

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

            Alternative 6: 83.0% accurate, 1.9× speedup?

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\sin y + x\right)} + z \]
                5. lift-sin.f6483.0

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

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

              Alternative 7: 82.1% accurate, 0.2× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin y + z\\ t_1 := \left(x + \sin y\right) + z \cdot \cos y\\ \mathbf{if}\;t\_1 \leq -1:\\ \;\;\;\;z + x\\ \mathbf{elif}\;t\_1 \leq -0.05:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0.0001:\\ \;\;\;\;\left(z + y\right) + x\\ \mathbf{elif}\;t\_1 \leq 1:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (let* ((t_0 (+ (sin y) z)) (t_1 (+ (+ x (sin y)) (* z (cos y)))))
                 (if (<= t_1 -1.0)
                   (+ z x)
                   (if (<= t_1 -0.05)
                     t_0
                     (if (<= t_1 0.0001) (+ (+ z y) x) (if (<= t_1 1.0) t_0 (+ z x)))))))
              double code(double x, double y, double z) {
              	double t_0 = sin(y) + z;
              	double t_1 = (x + sin(y)) + (z * cos(y));
              	double tmp;
              	if (t_1 <= -1.0) {
              		tmp = z + x;
              	} else if (t_1 <= -0.05) {
              		tmp = t_0;
              	} else if (t_1 <= 0.0001) {
              		tmp = (z + y) + x;
              	} else if (t_1 <= 1.0) {
              		tmp = t_0;
              	} 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) :: t_0
                  real(8) :: t_1
                  real(8) :: tmp
                  t_0 = sin(y) + z
                  t_1 = (x + sin(y)) + (z * cos(y))
                  if (t_1 <= (-1.0d0)) then
                      tmp = z + x
                  else if (t_1 <= (-0.05d0)) then
                      tmp = t_0
                  else if (t_1 <= 0.0001d0) then
                      tmp = (z + y) + x
                  else if (t_1 <= 1.0d0) then
                      tmp = t_0
                  else
                      tmp = z + x
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z) {
              	double t_0 = Math.sin(y) + z;
              	double t_1 = (x + Math.sin(y)) + (z * Math.cos(y));
              	double tmp;
              	if (t_1 <= -1.0) {
              		tmp = z + x;
              	} else if (t_1 <= -0.05) {
              		tmp = t_0;
              	} else if (t_1 <= 0.0001) {
              		tmp = (z + y) + x;
              	} else if (t_1 <= 1.0) {
              		tmp = t_0;
              	} else {
              		tmp = z + x;
              	}
              	return tmp;
              }
              
              def code(x, y, z):
              	t_0 = math.sin(y) + z
              	t_1 = (x + math.sin(y)) + (z * math.cos(y))
              	tmp = 0
              	if t_1 <= -1.0:
              		tmp = z + x
              	elif t_1 <= -0.05:
              		tmp = t_0
              	elif t_1 <= 0.0001:
              		tmp = (z + y) + x
              	elif t_1 <= 1.0:
              		tmp = t_0
              	else:
              		tmp = z + x
              	return tmp
              
              function code(x, y, z)
              	t_0 = Float64(sin(y) + z)
              	t_1 = Float64(Float64(x + sin(y)) + Float64(z * cos(y)))
              	tmp = 0.0
              	if (t_1 <= -1.0)
              		tmp = Float64(z + x);
              	elseif (t_1 <= -0.05)
              		tmp = t_0;
              	elseif (t_1 <= 0.0001)
              		tmp = Float64(Float64(z + y) + x);
              	elseif (t_1 <= 1.0)
              		tmp = t_0;
              	else
              		tmp = Float64(z + x);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z)
              	t_0 = sin(y) + z;
              	t_1 = (x + sin(y)) + (z * cos(y));
              	tmp = 0.0;
              	if (t_1 <= -1.0)
              		tmp = z + x;
              	elseif (t_1 <= -0.05)
              		tmp = t_0;
              	elseif (t_1 <= 0.0001)
              		tmp = (z + y) + x;
              	elseif (t_1 <= 1.0)
              		tmp = t_0;
              	else
              		tmp = z + x;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] + z), $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, -1.0], N[(z + x), $MachinePrecision], If[LessEqual[t$95$1, -0.05], t$95$0, If[LessEqual[t$95$1, 0.0001], N[(N[(z + y), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 1.0], t$95$0, N[(z + x), $MachinePrecision]]]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \sin y + z\\
              t_1 := \left(x + \sin y\right) + z \cdot \cos y\\
              \mathbf{if}\;t\_1 \leq -1:\\
              \;\;\;\;z + x\\
              
              \mathbf{elif}\;t\_1 \leq -0.05:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;t\_1 \leq 0.0001:\\
              \;\;\;\;\left(z + y\right) + x\\
              
              \mathbf{elif}\;t\_1 \leq 1:\\
              \;\;\;\;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))) < -1 or 1 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y)))

                1. Initial program 99.9%

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

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

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

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

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

                if -1 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -0.050000000000000003 or 1.00000000000000005e-4 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 1

                1. Initial program 99.9%

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

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

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

                    \[\leadsto \color{blue}{\sin y} + z \]
                  3. Step-by-step derivation
                    1. lift-sin.f6442.8

                      \[\leadsto \sin y + z \]
                  4. Applied rewrites42.8%

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

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

                  1. Initial program 99.9%

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

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

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

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

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

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

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

                Alternative 8: 70.2% accurate, 2.5× speedup?

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

                  1. Initial program 99.9%

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

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

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

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

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

                  if -9.6e11 < y < 1.62e21

                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 9: 70.2% accurate, 3.0× speedup?

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

                  1. Initial program 99.9%

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

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

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

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

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

                  if -1.09999999999999993e28 < y < 1.62e21

                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 10: 70.1% accurate, 3.0× speedup?

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

                    1. Initial program 99.9%

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

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

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

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

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

                    if -1.18e11 < y < 2.85e10

                    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 11: 70.1% accurate, 5.2× speedup?

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

                    1. Initial program 99.9%

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

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

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

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

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

                    if -9.5000000000000003e40 < y < 1.08e15

                    1. Initial program 99.9%

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

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

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

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

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

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

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

                  Alternative 12: 66.1% accurate, 19.6× speedup?

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

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

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

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

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

                    \[\leadsto \color{blue}{z + x} \]
                  5. Add Preprocessing

                  Alternative 13: 29.6% accurate, 19.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto z + \color{blue}{y} \]
                  8. Add Preprocessing

                  Alternative 14: 26.4% accurate, 73.1× speedup?

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

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

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

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

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

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

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

                      \[\leadsto z \]
                    2. Add Preprocessing

                    Reproduce

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