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

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

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.6% 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 -500 \lor \neg \left(t\_1 \leq 0.99\right):\\ \;\;\;\;\left(x + 1\right) - t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(-x\right) \cdot \left(-1 - \frac{\cos y}{x}\right)\\ \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 -500.0) (not (<= t_1 0.99)))
     (- (+ x 1.0) t_0)
     (* (- x) (- -1.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 <= -500.0) || !(t_1 <= 0.99)) {
		tmp = (x + 1.0) - t_0;
	} else {
		tmp = -x * (-1.0 - (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 <= (-500.0d0)) .or. (.not. (t_1 <= 0.99d0))) then
        tmp = (x + 1.0d0) - t_0
    else
        tmp = -x * ((-1.0d0) - (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 <= -500.0) || !(t_1 <= 0.99)) {
		tmp = (x + 1.0) - t_0;
	} else {
		tmp = -x * (-1.0 - (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 <= -500.0) or not (t_1 <= 0.99):
		tmp = (x + 1.0) - t_0
	else:
		tmp = -x * (-1.0 - (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 <= -500.0) || !(t_1 <= 0.99))
		tmp = Float64(Float64(x + 1.0) - t_0);
	else
		tmp = Float64(Float64(-x) * Float64(-1.0 - 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 <= -500.0) || ~((t_1 <= 0.99)))
		tmp = (x + 1.0) - t_0;
	else
		tmp = -x * (-1.0 - (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, -500.0], N[Not[LessEqual[t$95$1, 0.99]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[((-x) * N[(-1.0 - N[(N[Cos[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $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 -500 \lor \neg \left(t\_1 \leq 0.99\right):\\
\;\;\;\;\left(x + 1\right) - t\_0\\

\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \left(-1 - \frac{\cos y}{x}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -500 or 0.98999999999999999 < (-.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 y around 0

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

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

      if -500 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.98999999999999999

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 3: 93.6% accurate, 0.4× speedup?

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

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

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

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

            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 + \cos y\right) - \color{blue}{y \cdot z} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

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

                \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
            5. Applied rewrites77.4%

              \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
          5. Recombined 2 regimes into one program.
          6. Final simplification92.2%

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

          Alternative 4: 93.2% 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 -500 \lor \neg \left(t\_1 \leq 0.99\right):\\ \;\;\;\;\left(x + 1\right) - t\_0\\ \mathbf{else}:\\ \;\;\;\;\cos y - z \cdot y\\ \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 -500.0) (not (<= t_1 0.99)))
               (- (+ x 1.0) t_0)
               (- (cos y) (* z y)))))
          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 <= -500.0) || !(t_1 <= 0.99)) {
          		tmp = (x + 1.0) - t_0;
          	} else {
          		tmp = cos(y) - (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) :: t_0
              real(8) :: t_1
              real(8) :: tmp
              t_0 = z * sin(y)
              t_1 = (x + cos(y)) - t_0
              if ((t_1 <= (-500.0d0)) .or. (.not. (t_1 <= 0.99d0))) then
                  tmp = (x + 1.0d0) - t_0
              else
                  tmp = cos(y) - (z * y)
              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 <= -500.0) || !(t_1 <= 0.99)) {
          		tmp = (x + 1.0) - t_0;
          	} else {
          		tmp = Math.cos(y) - (z * y);
          	}
          	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 <= -500.0) or not (t_1 <= 0.99):
          		tmp = (x + 1.0) - t_0
          	else:
          		tmp = math.cos(y) - (z * y)
          	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 <= -500.0) || !(t_1 <= 0.99))
          		tmp = Float64(Float64(x + 1.0) - t_0);
          	else
          		tmp = Float64(cos(y) - Float64(z * y));
          	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 <= -500.0) || ~((t_1 <= 0.99)))
          		tmp = (x + 1.0) - t_0;
          	else
          		tmp = cos(y) - (z * y);
          	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, -500.0], N[Not[LessEqual[t$95$1, 0.99]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] - N[(z * y), $MachinePrecision]), $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 -500 \lor \neg \left(t\_1 \leq 0.99\right):\\
          \;\;\;\;\left(x + 1\right) - t\_0\\
          
          \mathbf{else}:\\
          \;\;\;\;\cos y - z \cdot y\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -500 or 0.98999999999999999 < (-.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 y around 0

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

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

              if -500 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.98999999999999999

              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 + \cos y\right) - \color{blue}{y \cdot z} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
                2. lower-*.f6445.3

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

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

                \[\leadsto \color{blue}{\cos y} - z \cdot y \]
              7. Step-by-step derivation
                1. lower-cos.f6445.3

                  \[\leadsto \color{blue}{\cos y} - z \cdot y \]
              8. Applied rewrites45.3%

                \[\leadsto \color{blue}{\cos y} - z \cdot y \]
            5. Recombined 2 regimes into one program.
            6. Final simplification92.2%

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

            Alternative 5: 98.6% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \sin y\\ \mathbf{if}\;x \leq -0.00092 \lor \neg \left(x \leq 1.8 \cdot 10^{-41}\right):\\ \;\;\;\;\left(x + 1\right) - t\_0\\ \mathbf{else}:\\ \;\;\;\;\cos y - t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (* z (sin y))))
               (if (or (<= x -0.00092) (not (<= x 1.8e-41)))
                 (- (+ x 1.0) t_0)
                 (- (cos y) t_0))))
            double code(double x, double y, double z) {
            	double t_0 = z * sin(y);
            	double tmp;
            	if ((x <= -0.00092) || !(x <= 1.8e-41)) {
            		tmp = (x + 1.0) - t_0;
            	} else {
            		tmp = cos(y) - t_0;
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, y, z)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: t_0
                real(8) :: tmp
                t_0 = z * sin(y)
                if ((x <= (-0.00092d0)) .or. (.not. (x <= 1.8d-41))) then
                    tmp = (x + 1.0d0) - t_0
                else
                    tmp = cos(y) - t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = z * Math.sin(y);
            	double tmp;
            	if ((x <= -0.00092) || !(x <= 1.8e-41)) {
            		tmp = (x + 1.0) - t_0;
            	} else {
            		tmp = Math.cos(y) - t_0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = z * math.sin(y)
            	tmp = 0
            	if (x <= -0.00092) or not (x <= 1.8e-41):
            		tmp = (x + 1.0) - t_0
            	else:
            		tmp = math.cos(y) - t_0
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(z * sin(y))
            	tmp = 0.0
            	if ((x <= -0.00092) || !(x <= 1.8e-41))
            		tmp = Float64(Float64(x + 1.0) - t_0);
            	else
            		tmp = Float64(cos(y) - t_0);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = z * sin(y);
            	tmp = 0.0;
            	if ((x <= -0.00092) || ~((x <= 1.8e-41)))
            		tmp = (x + 1.0) - t_0;
            	else
            		tmp = cos(y) - t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -0.00092], N[Not[LessEqual[x, 1.8e-41]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := z \cdot \sin y\\
            \mathbf{if}\;x \leq -0.00092 \lor \neg \left(x \leq 1.8 \cdot 10^{-41}\right):\\
            \;\;\;\;\left(x + 1\right) - t\_0\\
            
            \mathbf{else}:\\
            \;\;\;\;\cos y - t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -9.2000000000000003e-4 or 1.8e-41 < 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 \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
              4. Step-by-step derivation
                1. Applied rewrites99.9%

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

                if -9.2000000000000003e-4 < x < 1.8e-41

                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. lower-cos.f6499.9

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

                  \[\leadsto \color{blue}{\cos y} - z \cdot \sin y \]
              5. Recombined 2 regimes into one program.
              6. Final simplification99.9%

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

              Alternative 6: 70.5% accurate, 1.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.16 \cdot 10^{+149} \lor \neg \left(z \leq 3.2 \cdot 10^{+82}\right):\\ \;\;\;\;\left(-z\right) \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (or (<= z -1.16e+149) (not (<= z 3.2e+82))) (* (- z) (sin y)) (+ 1.0 x)))
              double code(double x, double y, double z) {
              	double tmp;
              	if ((z <= -1.16e+149) || !(z <= 3.2e+82)) {
              		tmp = -z * sin(y);
              	} else {
              		tmp = 1.0 + 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.16d+149)) .or. (.not. (z <= 3.2d+82))) then
                      tmp = -z * sin(y)
                  else
                      tmp = 1.0d0 + x
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z) {
              	double tmp;
              	if ((z <= -1.16e+149) || !(z <= 3.2e+82)) {
              		tmp = -z * Math.sin(y);
              	} else {
              		tmp = 1.0 + x;
              	}
              	return tmp;
              }
              
              def code(x, y, z):
              	tmp = 0
              	if (z <= -1.16e+149) or not (z <= 3.2e+82):
              		tmp = -z * math.sin(y)
              	else:
              		tmp = 1.0 + x
              	return tmp
              
              function code(x, y, z)
              	tmp = 0.0
              	if ((z <= -1.16e+149) || !(z <= 3.2e+82))
              		tmp = Float64(Float64(-z) * sin(y));
              	else
              		tmp = Float64(1.0 + x);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z)
              	tmp = 0.0;
              	if ((z <= -1.16e+149) || ~((z <= 3.2e+82)))
              		tmp = -z * sin(y);
              	else
              		tmp = 1.0 + x;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_] := If[Or[LessEqual[z, -1.16e+149], N[Not[LessEqual[z, 3.2e+82]], $MachinePrecision]], N[((-z) * N[Sin[y], $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -1.16 \cdot 10^{+149} \lor \neg \left(z \leq 3.2 \cdot 10^{+82}\right):\\
              \;\;\;\;\left(-z\right) \cdot \sin y\\
              
              \mathbf{else}:\\
              \;\;\;\;1 + x\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if z < -1.16e149 or 3.19999999999999975e82 < 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 \color{blue}{\mathsf{neg}\left(z \cdot \sin y\right)} \]
                  2. distribute-lft-neg-inN/A

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

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

                    \[\leadsto \color{blue}{\left(-z\right)} \cdot \sin y \]
                  5. lower-sin.f6479.9

                    \[\leadsto \left(-z\right) \cdot \color{blue}{\sin y} \]
                5. Applied rewrites79.9%

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

                if -1.16e149 < z < 3.19999999999999975e82

                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 + x} \]
                4. Step-by-step derivation
                  1. lower-+.f6478.4

                    \[\leadsto \color{blue}{1 + x} \]
                5. Applied rewrites78.4%

                  \[\leadsto \color{blue}{1 + x} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification78.7%

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

              Alternative 7: 69.1% accurate, 5.6× speedup?

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

                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. lower-+.f6444.9

                    \[\leadsto \color{blue}{1 + x} \]
                5. Applied rewrites44.9%

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

                if -6.20000000000000038e53 < y < 6.9999999999999998e41

                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 \color{blue}{\left(x + y \cdot \left(y \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) - \frac{1}{2}\right) - z\right)\right) + 1} \]
                  2. +-commutativeN/A

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

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

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+53} \lor \neg \left(y \leq 7 \cdot 10^{+41}\right):\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot y, y, -1\right) \cdot z, y, 1 + x\right)\\ \end{array} \]
                10. Add Preprocessing

                Alternative 8: 69.1% accurate, 9.6× speedup?

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

                  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. lower-+.f6443.3

                      \[\leadsto \color{blue}{1 + x} \]
                  5. Applied rewrites43.3%

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

                  if -2.2000000000000001e49 < y < 1.9e84

                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{x - \left(y \cdot z - 1\right)} \]
                        7. remove-double-negN/A

                          \[\leadsto x - \left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(y \cdot z\right)\right)\right)\right)} - 1\right) \]
                        8. *-commutativeN/A

                          \[\leadsto x - \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{z \cdot y}\right)\right)\right)\right) - 1\right) \]
                        9. distribute-lft-neg-inN/A

                          \[\leadsto x - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot y}\right)\right) - 1\right) \]
                        10. mul-1-negN/A

                          \[\leadsto x - \left(\left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z\right)} \cdot y\right)\right) - 1\right) \]
                        11. distribute-rgt-neg-inN/A

                          \[\leadsto x - \left(\color{blue}{\left(-1 \cdot z\right) \cdot \left(\mathsf{neg}\left(y\right)\right)} - 1\right) \]
                        12. rgt-mult-inverseN/A

                          \[\leadsto x - \left(\left(-1 \cdot z\right) \cdot \left(\mathsf{neg}\left(y\right)\right) - \color{blue}{z \cdot \frac{1}{z}}\right) \]
                        13. fp-cancel-sub-signN/A

                          \[\leadsto x - \color{blue}{\left(\left(-1 \cdot z\right) \cdot \left(\mathsf{neg}\left(y\right)\right) + \left(\mathsf{neg}\left(z\right)\right) \cdot \frac{1}{z}\right)} \]
                        14. mul-1-negN/A

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

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

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

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

                          \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot y + \frac{1}{z}\right)\right)\right)} \]
                        19. distribute-rgt-inN/A

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

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

                          \[\leadsto x - \color{blue}{\left(\left(\mathsf{neg}\left(-1 \cdot \left(y \cdot z\right)\right)\right) + \left(\mathsf{neg}\left(\frac{1}{z} \cdot z\right)\right)\right)} \]
                      4. Applied rewrites91.7%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+49} \lor \neg \left(y \leq 1.9 \cdot 10^{+84}\right):\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 9: 60.9% accurate, 10.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+154} \lor \neg \left(z \leq 7.7 \cdot 10^{+205}\right):\\ \;\;\;\;\left(-y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
                    (FPCore (x y z)
                     :precision binary64
                     (if (or (<= z -4e+154) (not (<= z 7.7e+205))) (* (- y) z) (+ 1.0 x)))
                    double code(double x, double y, double z) {
                    	double tmp;
                    	if ((z <= -4e+154) || !(z <= 7.7e+205)) {
                    		tmp = -y * z;
                    	} else {
                    		tmp = 1.0 + 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 <= (-4d+154)) .or. (.not. (z <= 7.7d+205))) then
                            tmp = -y * z
                        else
                            tmp = 1.0d0 + x
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z) {
                    	double tmp;
                    	if ((z <= -4e+154) || !(z <= 7.7e+205)) {
                    		tmp = -y * z;
                    	} else {
                    		tmp = 1.0 + x;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z):
                    	tmp = 0
                    	if (z <= -4e+154) or not (z <= 7.7e+205):
                    		tmp = -y * z
                    	else:
                    		tmp = 1.0 + x
                    	return tmp
                    
                    function code(x, y, z)
                    	tmp = 0.0
                    	if ((z <= -4e+154) || !(z <= 7.7e+205))
                    		tmp = Float64(Float64(-y) * z);
                    	else
                    		tmp = Float64(1.0 + x);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z)
                    	tmp = 0.0;
                    	if ((z <= -4e+154) || ~((z <= 7.7e+205)))
                    		tmp = -y * z;
                    	else
                    		tmp = 1.0 + x;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_] := If[Or[LessEqual[z, -4e+154], N[Not[LessEqual[z, 7.7e+205]], $MachinePrecision]], N[((-y) * z), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;z \leq -4 \cdot 10^{+154} \lor \neg \left(z \leq 7.7 \cdot 10^{+205}\right):\\
                    \;\;\;\;\left(-y\right) \cdot z\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;1 + x\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if z < -4.00000000000000015e154 or 7.6999999999999999e205 < 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 \color{blue}{\mathsf{neg}\left(z \cdot \sin y\right)} \]
                        2. distribute-lft-neg-inN/A

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

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

                          \[\leadsto \color{blue}{\left(-z\right)} \cdot \sin y \]
                        5. lower-sin.f6492.6

                          \[\leadsto \left(-z\right) \cdot \color{blue}{\sin y} \]
                      5. Applied rewrites92.6%

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

                        \[\leadsto -1 \cdot \color{blue}{\left(y \cdot z\right)} \]
                      7. Step-by-step derivation
                        1. Applied rewrites42.4%

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

                        if -4.00000000000000015e154 < z < 7.6999999999999999e205

                        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 + x} \]
                        4. Step-by-step derivation
                          1. lower-+.f6475.3

                            \[\leadsto \color{blue}{1 + x} \]
                        5. Applied rewrites75.3%

                          \[\leadsto \color{blue}{1 + x} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification70.4%

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

                      Alternative 10: 61.2% accurate, 53.0× speedup?

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

                        \[\leadsto \color{blue}{1 + x} \]
                      4. Step-by-step derivation
                        1. lower-+.f6465.4

                          \[\leadsto \color{blue}{1 + x} \]
                      5. Applied rewrites65.4%

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

                      Alternative 11: 21.3% accurate, 212.0× speedup?

                      \[\begin{array}{l} \\ 1 \end{array} \]
                      (FPCore (x y z) :precision binary64 1.0)
                      double code(double x, double y, double z) {
                      	return 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 = 1.0d0
                      end function
                      
                      public static double code(double x, double y, double z) {
                      	return 1.0;
                      }
                      
                      def code(x, y, z):
                      	return 1.0
                      
                      function code(x, y, z)
                      	return 1.0
                      end
                      
                      function tmp = code(x, y, z)
                      	tmp = 1.0;
                      end
                      
                      code[x_, y_, z_] := 1.0
                      
                      \begin{array}{l}
                      
                      \\
                      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. lower-+.f6465.4

                          \[\leadsto \color{blue}{1 + x} \]
                      5. Applied rewrites65.4%

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

                        \[\leadsto 1 \]
                      7. Step-by-step derivation
                        1. Applied rewrites21.9%

                          \[\leadsto 1 \]
                        2. Add Preprocessing

                        Reproduce

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