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

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

Specification

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

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

    \[\left(x + \cos y\right) - z \cdot \sin y \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 98.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
t_1 := \left(x + \cos y\right) - t\_0\\
\mathbf{if}\;t\_1 \leq -1 \lor \neg \left(t\_1 \leq 2\right):\\
\;\;\;\;x - t\_0\\

\mathbf{else}:\\
\;\;\;\;\cos y + x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -1 or 2 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y)))

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} - z \cdot \sin y \]
    4. Step-by-step derivation
      1. Applied rewrites96.9%

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

      if -1 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 2

      1. Initial program 100.0%

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

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

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

          \[\leadsto \cos y + \color{blue}{x} \]
        3. lift-cos.f6498.1

          \[\leadsto \cos y + x \]
      5. Applied rewrites98.1%

        \[\leadsto \color{blue}{\cos y + x} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification97.3%

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

    Alternative 3: 99.0% accurate, 1.0× speedup?

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

      1. Initial program 100.0%

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

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

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

        if -0.900000000000000022 < x < 2.49999999999999989e-7

        1. Initial program 99.9%

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

          \[\leadsto \color{blue}{\cos y} - z \cdot \sin y \]
        4. Step-by-step derivation
          1. lift-cos.f6499.4

            \[\leadsto \cos y - z \cdot \sin y \]
        5. Applied rewrites99.4%

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

        if 2.49999999999999989e-7 < x

        1. Initial program 99.9%

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

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

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

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

            \[\leadsto \left(\left(\frac{x}{z} + \frac{\cos y}{z}\right) - \sin y\right) \cdot z \]
          4. div-add-revN/A

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

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

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

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

            \[\leadsto \left(\frac{\cos y + x}{z} - \sin y\right) \cdot z \]
          9. lift-sin.f6467.5

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(z, \frac{\frac{\cos y}{z} - \sin y}{x}, 1\right) \cdot x \]
        8. Applied rewrites99.9%

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

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

            \[\leadsto \mathsf{fma}\left(z, \frac{\frac{1}{z} - \sin y}{x}, 1\right) \cdot x \]
        11. Recombined 3 regimes into one program.
        12. Add Preprocessing

        Alternative 4: 99.4% accurate, 1.7× speedup?

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

          1. Initial program 99.8%

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

            \[\leadsto \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
          4. Step-by-step derivation
            1. Applied rewrites98.6%

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

            if -1.3999999999999999 < z < 3.89999999999999991

            1. Initial program 100.0%

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

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

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

                \[\leadsto \cos y + \color{blue}{x} \]
              3. lift-cos.f6499.1

                \[\leadsto \cos y + x \]
            5. Applied rewrites99.1%

              \[\leadsto \color{blue}{\cos y + x} \]
          5. Recombined 2 regimes into one program.
          6. Final simplification98.9%

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \lor \neg \left(z \leq 3.9\right):\\ \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;\cos y + x\\ \end{array} \]
          7. Add Preprocessing

          Alternative 5: 82.5% accurate, 1.8× speedup?

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

            1. Initial program 99.8%

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

              \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \sin y\right)} \]
            4. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{neg}\left(z \cdot \sin y\right) \]
              2. distribute-lft-neg-inN/A

                \[\leadsto \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{\sin y} \]
              3. lower-*.f64N/A

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

                \[\leadsto \left(-z\right) \cdot \sin \color{blue}{y} \]
              5. lift-sin.f6480.7

                \[\leadsto \left(-z\right) \cdot \sin y \]
            5. Applied rewrites80.7%

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

            if -1e173 < z < 3.70000000000000001e195

            1. Initial program 99.9%

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

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

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

                \[\leadsto \cos y + \color{blue}{x} \]
              3. lift-cos.f6487.0

                \[\leadsto \cos y + x \]
            5. Applied rewrites87.0%

              \[\leadsto \color{blue}{\cos y + x} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification85.9%

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

          Alternative 6: 81.2% accurate, 1.8× speedup?

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

            1. Initial program 99.8%

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

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

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

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

                \[\leadsto \cos y + x \]
            5. Applied rewrites66.5%

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

            if -7.1999999999999997e23 < y < 0.75

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(\frac{1}{6} \cdot \left(z \cdot y\right) - \frac{1}{2}\right) \cdot y - z, y, x - -1\right) \]
            5. Applied rewrites99.2%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+23} \lor \neg \left(y \leq 0.75\right):\\ \;\;\;\;\cos y + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(0.16666666666666666 \cdot \left(z \cdot y\right) - 0.5\right) \cdot y - z, y, x - -1\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 7: 70.5% accurate, 4.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+23} \lor \neg \left(y \leq 2.8 \cdot 10^{+27}\right):\\ \;\;\;\;x - -1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(0.16666666666666666 \cdot \left(z \cdot y\right) - 0.5\right) \cdot y - z, y, x - -1\right)\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (or (<= y -7.2e+23) (not (<= y 2.8e+27)))
             (- x -1.0)
             (fma (- (* (- (* 0.16666666666666666 (* z y)) 0.5) y) z) y (- x -1.0))))
          double code(double x, double y, double z) {
          	double tmp;
          	if ((y <= -7.2e+23) || !(y <= 2.8e+27)) {
          		tmp = x - -1.0;
          	} else {
          		tmp = fma(((((0.16666666666666666 * (z * y)) - 0.5) * y) - z), y, (x - -1.0));
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if ((y <= -7.2e+23) || !(y <= 2.8e+27))
          		tmp = Float64(x - -1.0);
          	else
          		tmp = fma(Float64(Float64(Float64(Float64(0.16666666666666666 * Float64(z * y)) - 0.5) * y) - z), y, Float64(x - -1.0));
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[Or[LessEqual[y, -7.2e+23], N[Not[LessEqual[y, 2.8e+27]], $MachinePrecision]], N[(x - -1.0), $MachinePrecision], N[(N[(N[(N[(N[(0.16666666666666666 * N[(z * y), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(x - -1.0), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -7.2 \cdot 10^{+23} \lor \neg \left(y \leq 2.8 \cdot 10^{+27}\right):\\
          \;\;\;\;x - -1\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\left(0.16666666666666666 \cdot \left(z \cdot y\right) - 0.5\right) \cdot y - z, y, x - -1\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -7.1999999999999997e23 or 2.7999999999999999e27 < y

            1. Initial program 99.8%

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

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

                \[\leadsto x + \color{blue}{1} \]
              2. metadata-evalN/A

                \[\leadsto x + 1 \cdot \color{blue}{1} \]
              3. fp-cancel-sign-sub-invN/A

                \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(1\right)\right) \cdot 1} \]
              4. metadata-evalN/A

                \[\leadsto x - -1 \cdot 1 \]
              5. metadata-evalN/A

                \[\leadsto x - -1 \]
              6. lower--.f6435.5

                \[\leadsto x - \color{blue}{-1} \]
            5. Applied rewrites35.5%

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

            if -7.1999999999999997e23 < y < 2.7999999999999999e27

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(\frac{1}{6} \cdot \left(z \cdot y\right) - \frac{1}{2}\right) \cdot y - z, y, x - -1\right) \]
            5. Applied rewrites95.2%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+23} \lor \neg \left(y \leq 2.8 \cdot 10^{+27}\right):\\ \;\;\;\;x - -1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(0.16666666666666666 \cdot \left(z \cdot y\right) - 0.5\right) \cdot y - z, y, x - -1\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 8: 70.3% accurate, 8.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+69}:\\ \;\;\;\;\left(1 + \frac{1}{x}\right) \cdot x\\ \mathbf{elif}\;y \leq 1050000000000:\\ \;\;\;\;\left(x - z \cdot y\right) - -1\\ \mathbf{else}:\\ \;\;\;\;x - -1\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= y -1.2e+69)
             (* (+ 1.0 (/ 1.0 x)) x)
             (if (<= y 1050000000000.0) (- (- x (* z y)) -1.0) (- x -1.0))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (y <= -1.2e+69) {
          		tmp = (1.0 + (1.0 / x)) * x;
          	} else if (y <= 1050000000000.0) {
          		tmp = (x - (z * y)) - -1.0;
          	} else {
          		tmp = x - -1.0;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8) :: tmp
              if (y <= (-1.2d+69)) then
                  tmp = (1.0d0 + (1.0d0 / x)) * x
              else if (y <= 1050000000000.0d0) then
                  tmp = (x - (z * y)) - (-1.0d0)
              else
                  tmp = x - (-1.0d0)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double tmp;
          	if (y <= -1.2e+69) {
          		tmp = (1.0 + (1.0 / x)) * x;
          	} else if (y <= 1050000000000.0) {
          		tmp = (x - (z * y)) - -1.0;
          	} else {
          		tmp = x - -1.0;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	tmp = 0
          	if y <= -1.2e+69:
          		tmp = (1.0 + (1.0 / x)) * x
          	elif y <= 1050000000000.0:
          		tmp = (x - (z * y)) - -1.0
          	else:
          		tmp = x - -1.0
          	return tmp
          
          function code(x, y, z)
          	tmp = 0.0
          	if (y <= -1.2e+69)
          		tmp = Float64(Float64(1.0 + Float64(1.0 / x)) * x);
          	elseif (y <= 1050000000000.0)
          		tmp = Float64(Float64(x - Float64(z * y)) - -1.0);
          	else
          		tmp = Float64(x - -1.0);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	tmp = 0.0;
          	if (y <= -1.2e+69)
          		tmp = (1.0 + (1.0 / x)) * x;
          	elseif (y <= 1050000000000.0)
          		tmp = (x - (z * y)) - -1.0;
          	else
          		tmp = x - -1.0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := If[LessEqual[y, -1.2e+69], N[(N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 1050000000000.0], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision], N[(x - -1.0), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -1.2 \cdot 10^{+69}:\\
          \;\;\;\;\left(1 + \frac{1}{x}\right) \cdot x\\
          
          \mathbf{elif}\;y \leq 1050000000000:\\
          \;\;\;\;\left(x - z \cdot y\right) - -1\\
          
          \mathbf{else}:\\
          \;\;\;\;x - -1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -1.2000000000000001e69

            1. Initial program 99.8%

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

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

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

                \[\leadsto \left(\left(1 + \frac{\cos y}{x}\right) - \frac{z \cdot \sin y}{x}\right) \cdot \color{blue}{x} \]
            5. Applied rewrites85.7%

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

              \[\leadsto \left(1 + \frac{1}{x}\right) \cdot x \]
            7. Step-by-step derivation
              1. Applied rewrites33.1%

                \[\leadsto \left(1 + \frac{1}{x}\right) \cdot x \]

              if -1.2000000000000001e69 < y < 1.05e12

              1. Initial program 100.0%

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

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

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

                  \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) + 1 \cdot \color{blue}{1} \]
                3. fp-cancel-sign-sub-invN/A

                  \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - \color{blue}{\left(\mathsf{neg}\left(1\right)\right) \cdot 1} \]
                4. metadata-evalN/A

                  \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - -1 \cdot 1 \]
                5. metadata-evalN/A

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

                  \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - \color{blue}{-1} \]
                7. metadata-evalN/A

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

                  \[\leadsto \left(x - 1 \cdot \left(y \cdot z\right)\right) - -1 \]
                9. *-lft-identityN/A

                  \[\leadsto \left(x - y \cdot z\right) - -1 \]
                10. lower--.f64N/A

                  \[\leadsto \left(x - y \cdot z\right) - -1 \]
                11. *-commutativeN/A

                  \[\leadsto \left(x - z \cdot y\right) - -1 \]
                12. lower-*.f6494.7

                  \[\leadsto \left(x - z \cdot y\right) - -1 \]
              5. Applied rewrites94.7%

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

              if 1.05e12 < y

              1. Initial program 99.8%

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

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

                  \[\leadsto x + \color{blue}{1} \]
                2. metadata-evalN/A

                  \[\leadsto x + 1 \cdot \color{blue}{1} \]
                3. fp-cancel-sign-sub-invN/A

                  \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(1\right)\right) \cdot 1} \]
                4. metadata-evalN/A

                  \[\leadsto x - -1 \cdot 1 \]
                5. metadata-evalN/A

                  \[\leadsto x - -1 \]
                6. lower--.f6435.1

                  \[\leadsto x - \color{blue}{-1} \]
              5. Applied rewrites35.1%

                \[\leadsto \color{blue}{x - -1} \]
            8. Recombined 3 regimes into one program.
            9. Add Preprocessing

            Alternative 9: 70.3% accurate, 8.8× speedup?

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

              1. Initial program 99.8%

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

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

                  \[\leadsto x + \color{blue}{1} \]
                2. metadata-evalN/A

                  \[\leadsto x + 1 \cdot \color{blue}{1} \]
                3. fp-cancel-sign-sub-invN/A

                  \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(1\right)\right) \cdot 1} \]
                4. metadata-evalN/A

                  \[\leadsto x - -1 \cdot 1 \]
                5. metadata-evalN/A

                  \[\leadsto x - -1 \]
                6. lower--.f6434.8

                  \[\leadsto x - \color{blue}{-1} \]
              5. Applied rewrites34.8%

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

              if -1.66e75 < y < 1.05e12

              1. Initial program 100.0%

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

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

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

                  \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) + 1 \cdot \color{blue}{1} \]
                3. fp-cancel-sign-sub-invN/A

                  \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - \color{blue}{\left(\mathsf{neg}\left(1\right)\right) \cdot 1} \]
                4. metadata-evalN/A

                  \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - -1 \cdot 1 \]
                5. metadata-evalN/A

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

                  \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - \color{blue}{-1} \]
                7. metadata-evalN/A

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

                  \[\leadsto \left(x - 1 \cdot \left(y \cdot z\right)\right) - -1 \]
                9. *-lft-identityN/A

                  \[\leadsto \left(x - y \cdot z\right) - -1 \]
                10. lower--.f64N/A

                  \[\leadsto \left(x - y \cdot z\right) - -1 \]
                11. *-commutativeN/A

                  \[\leadsto \left(x - z \cdot y\right) - -1 \]
                12. lower-*.f6493.6

                  \[\leadsto \left(x - z \cdot y\right) - -1 \]
              5. Applied rewrites93.6%

                \[\leadsto \color{blue}{\left(x - z \cdot y\right) - -1} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification68.5%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.66 \cdot 10^{+75} \lor \neg \left(y \leq 1050000000000\right):\\ \;\;\;\;x - -1\\ \mathbf{else}:\\ \;\;\;\;\left(x - z \cdot y\right) - -1\\ \end{array} \]
            5. Add Preprocessing

            Alternative 10: 67.7% accurate, 10.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.75 \cdot 10^{-11} \lor \neg \left(x \leq 5.8 \cdot 10^{-15}\right):\\ \;\;\;\;x - -1\\ \mathbf{else}:\\ \;\;\;\;1 - z \cdot y\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= x -2.75e-11) (not (<= x 5.8e-15))) (- x -1.0) (- 1.0 (* z y))))
            double code(double x, double y, double z) {
            	double tmp;
            	if ((x <= -2.75e-11) || !(x <= 5.8e-15)) {
            		tmp = x - -1.0;
            	} else {
            		tmp = 1.0 - (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 <= (-2.75d-11)) .or. (.not. (x <= 5.8d-15))) then
                    tmp = x - (-1.0d0)
                else
                    tmp = 1.0d0 - (z * y)
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double tmp;
            	if ((x <= -2.75e-11) || !(x <= 5.8e-15)) {
            		tmp = x - -1.0;
            	} else {
            		tmp = 1.0 - (z * y);
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	tmp = 0
            	if (x <= -2.75e-11) or not (x <= 5.8e-15):
            		tmp = x - -1.0
            	else:
            		tmp = 1.0 - (z * y)
            	return tmp
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((x <= -2.75e-11) || !(x <= 5.8e-15))
            		tmp = Float64(x - -1.0);
            	else
            		tmp = Float64(1.0 - Float64(z * y));
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	tmp = 0.0;
            	if ((x <= -2.75e-11) || ~((x <= 5.8e-15)))
            		tmp = x - -1.0;
            	else
            		tmp = 1.0 - (z * y);
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[x, -2.75e-11], N[Not[LessEqual[x, 5.8e-15]], $MachinePrecision]], N[(x - -1.0), $MachinePrecision], N[(1.0 - N[(z * y), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq -2.75 \cdot 10^{-11} \lor \neg \left(x \leq 5.8 \cdot 10^{-15}\right):\\
            \;\;\;\;x - -1\\
            
            \mathbf{else}:\\
            \;\;\;\;1 - z \cdot y\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -2.74999999999999987e-11 or 5.80000000000000037e-15 < x

              1. Initial program 99.9%

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

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

                  \[\leadsto x + \color{blue}{1} \]
                2. metadata-evalN/A

                  \[\leadsto x + 1 \cdot \color{blue}{1} \]
                3. fp-cancel-sign-sub-invN/A

                  \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(1\right)\right) \cdot 1} \]
                4. metadata-evalN/A

                  \[\leadsto x - -1 \cdot 1 \]
                5. metadata-evalN/A

                  \[\leadsto x - -1 \]
                6. lower--.f6482.8

                  \[\leadsto x - \color{blue}{-1} \]
              5. Applied rewrites82.8%

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

              if -2.74999999999999987e-11 < x < 5.80000000000000037e-15

              1. Initial program 99.9%

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

                \[\leadsto \color{blue}{\cos y} - z \cdot \sin y \]
              4. Step-by-step derivation
                1. lift-cos.f6499.9

                  \[\leadsto \cos y - z \cdot \sin y \]
              5. Applied rewrites99.9%

                \[\leadsto \color{blue}{\cos y} - z \cdot \sin y \]
              6. Taylor expanded in y around 0

                \[\leadsto 1 - z \cdot \sin y \]
              7. Step-by-step derivation
                1. Applied rewrites71.2%

                  \[\leadsto 1 - z \cdot \sin y \]
                2. Taylor expanded in y around 0

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

                    \[\leadsto 1 - z \cdot \color{blue}{y} \]
                4. Recombined 2 regimes into one program.
                5. Final simplification65.7%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.75 \cdot 10^{-11} \lor \neg \left(x \leq 5.8 \cdot 10^{-15}\right):\\ \;\;\;\;x - -1\\ \mathbf{else}:\\ \;\;\;\;1 - z \cdot y\\ \end{array} \]
                6. Add Preprocessing

                Alternative 11: 63.1% accurate, 10.6× speedup?

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

                  1. Initial program 99.8%

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

                    \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \sin y\right)} \]
                  4. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{neg}\left(z \cdot \sin y\right) \]
                    2. distribute-lft-neg-inN/A

                      \[\leadsto \left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{\sin y} \]
                    3. lower-*.f64N/A

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

                      \[\leadsto \left(-z\right) \cdot \sin \color{blue}{y} \]
                    5. lift-sin.f6480.7

                      \[\leadsto \left(-z\right) \cdot \sin y \]
                  5. Applied rewrites80.7%

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

                    \[\leadsto \left(-z\right) \cdot y \]
                  7. Step-by-step derivation
                    1. Applied rewrites39.6%

                      \[\leadsto \left(-z\right) \cdot y \]

                    if -5e175 < z < 3.99999999999999991e195

                    1. Initial program 99.9%

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

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

                        \[\leadsto x + \color{blue}{1} \]
                      2. metadata-evalN/A

                        \[\leadsto x + 1 \cdot \color{blue}{1} \]
                      3. fp-cancel-sign-sub-invN/A

                        \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(1\right)\right) \cdot 1} \]
                      4. metadata-evalN/A

                        \[\leadsto x - -1 \cdot 1 \]
                      5. metadata-evalN/A

                        \[\leadsto x - -1 \]
                      6. lower--.f6468.8

                        \[\leadsto x - \color{blue}{-1} \]
                    5. Applied rewrites68.8%

                      \[\leadsto \color{blue}{x - -1} \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification63.7%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+175} \lor \neg \left(z \leq 4 \cdot 10^{+195}\right):\\ \;\;\;\;\left(-z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - -1\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 12: 61.4% accurate, 16.3× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.07:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                  (FPCore (x y z) :precision binary64 (if (<= x -0.07) x (if (<= x 1.0) 1.0 x)))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if (x <= -0.07) {
                  		tmp = x;
                  	} else if (x <= 1.0) {
                  		tmp = 1.0;
                  	} else {
                  		tmp = x;
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y, z)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8) :: tmp
                      if (x <= (-0.07d0)) then
                          tmp = x
                      else if (x <= 1.0d0) then
                          tmp = 1.0d0
                      else
                          tmp = x
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	double tmp;
                  	if (x <= -0.07) {
                  		tmp = x;
                  	} else if (x <= 1.0) {
                  		tmp = 1.0;
                  	} else {
                  		tmp = x;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z):
                  	tmp = 0
                  	if x <= -0.07:
                  		tmp = x
                  	elif x <= 1.0:
                  		tmp = 1.0
                  	else:
                  		tmp = x
                  	return tmp
                  
                  function code(x, y, z)
                  	tmp = 0.0
                  	if (x <= -0.07)
                  		tmp = x;
                  	elseif (x <= 1.0)
                  		tmp = 1.0;
                  	else
                  		tmp = x;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z)
                  	tmp = 0.0;
                  	if (x <= -0.07)
                  		tmp = x;
                  	elseif (x <= 1.0)
                  		tmp = 1.0;
                  	else
                  		tmp = x;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_] := If[LessEqual[x, -0.07], x, If[LessEqual[x, 1.0], 1.0, x]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;x \leq -0.07:\\
                  \;\;\;\;x\\
                  
                  \mathbf{elif}\;x \leq 1:\\
                  \;\;\;\;1\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;x\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if x < -0.070000000000000007 or 1 < x

                    1. Initial program 99.9%

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

                      \[\leadsto \color{blue}{x} \]
                    4. Step-by-step derivation
                      1. Applied rewrites83.2%

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

                      if -0.070000000000000007 < x < 1

                      1. Initial program 99.9%

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

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

                          \[\leadsto x + \color{blue}{1} \]
                        2. metadata-evalN/A

                          \[\leadsto x + 1 \cdot \color{blue}{1} \]
                        3. fp-cancel-sign-sub-invN/A

                          \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(1\right)\right) \cdot 1} \]
                        4. metadata-evalN/A

                          \[\leadsto x - -1 \cdot 1 \]
                        5. metadata-evalN/A

                          \[\leadsto x - -1 \]
                        6. lower--.f6439.1

                          \[\leadsto x - \color{blue}{-1} \]
                      5. Applied rewrites39.1%

                        \[\leadsto \color{blue}{x - -1} \]
                      6. Taylor expanded in x around 0

                        \[\leadsto 1 \]
                      7. Step-by-step derivation
                        1. Applied rewrites38.6%

                          \[\leadsto 1 \]
                      8. Recombined 2 regimes into one program.
                      9. Add Preprocessing

                      Alternative 13: 62.2% accurate, 53.0× speedup?

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

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

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

                          \[\leadsto x + \color{blue}{1} \]
                        2. metadata-evalN/A

                          \[\leadsto x + 1 \cdot \color{blue}{1} \]
                        3. fp-cancel-sign-sub-invN/A

                          \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(1\right)\right) \cdot 1} \]
                        4. metadata-evalN/A

                          \[\leadsto x - -1 \cdot 1 \]
                        5. metadata-evalN/A

                          \[\leadsto x - -1 \]
                        6. lower--.f6459.7

                          \[\leadsto x - \color{blue}{-1} \]
                      5. Applied rewrites59.7%

                        \[\leadsto \color{blue}{x - -1} \]
                      6. Add Preprocessing

                      Alternative 14: 43.2% 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 + \cos y\right) - z \cdot \sin y \]
                      2. Add Preprocessing
                      3. Taylor expanded in x around inf

                        \[\leadsto \color{blue}{x} \]
                      4. Step-by-step derivation
                        1. Applied rewrites40.1%

                          \[\leadsto \color{blue}{x} \]
                        2. Add Preprocessing

                        Reproduce

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