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

Percentage Accurate: 99.9% → 99.9%
Time: 7.4s
Alternatives: 16
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 16 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.0% 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 -2000000000 \lor \neg \left(t\_1 \leq 0.998\right):\\ \;\;\;\;\left(x + 1\right) - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos y}{x} \cdot 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 -2000000000.0) (not (<= t_1 0.998)))
     (- (+ x 1.0) t_0)
     (* (/ (cos y) x) 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 <= -2000000000.0) || !(t_1 <= 0.998)) {
		tmp = (x + 1.0) - t_0;
	} else {
		tmp = (cos(y) / x) * 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 <= (-2000000000.0d0)) .or. (.not. (t_1 <= 0.998d0))) then
        tmp = (x + 1.0d0) - t_0
    else
        tmp = (cos(y) / x) * 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 <= -2000000000.0) || !(t_1 <= 0.998)) {
		tmp = (x + 1.0) - t_0;
	} else {
		tmp = (Math.cos(y) / x) * 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 <= -2000000000.0) or not (t_1 <= 0.998):
		tmp = (x + 1.0) - t_0
	else:
		tmp = (math.cos(y) / x) * 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 <= -2000000000.0) || !(t_1 <= 0.998))
		tmp = Float64(Float64(x + 1.0) - t_0);
	else
		tmp = Float64(Float64(cos(y) / x) * 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 <= -2000000000.0) || ~((t_1 <= 0.998)))
		tmp = (x + 1.0) - t_0;
	else
		tmp = (cos(y) / x) * 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, -2000000000.0], N[Not[LessEqual[t$95$1, 0.998]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[Cos[y], $MachinePrecision] / x), $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 -2000000000 \lor \neg \left(t\_1 \leq 0.998\right):\\
\;\;\;\;\left(x + 1\right) - t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\cos y}{x} \cdot 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))) < -2e9 or 0.998 < (-.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.0%

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

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

          \[\leadsto \left(\frac{\cos y + x}{z} - \color{blue}{\sin y}\right) \cdot z \]
      5. Applied rewrites99.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. Applied rewrites99.2%

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

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

            \[\leadsto \frac{\cos y + x}{x} \cdot x \]
          2. Taylor expanded in x around 0

            \[\leadsto \frac{\cos y}{x} \cdot x \]
          3. Step-by-step derivation
            1. Applied rewrites96.5%

              \[\leadsto \frac{\cos y}{x} \cdot x \]
          4. Recombined 2 regimes into one program.
          5. Final simplification98.6%

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

          Alternative 3: 92.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 -5 \cdot 10^{+26} \lor \neg \left(t\_2 \leq 0.99999999995\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 -5e+26) (not (<= t_2 0.99999999995)))
               (- (+ 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 <= -5e+26) || !(t_2 <= 0.99999999995)) {
          		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 <= (-5d+26)) .or. (.not. (t_2 <= 0.99999999995d0))) 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 <= -5e+26) || !(t_2 <= 0.99999999995)) {
          		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 <= -5e+26) or not (t_2 <= 0.99999999995):
          		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 <= -5e+26) || !(t_2 <= 0.99999999995))
          		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 <= -5e+26) || ~((t_2 <= 0.99999999995)))
          		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, -5e+26], N[Not[LessEqual[t$95$2, 0.99999999995]], $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 -5 \cdot 10^{+26} \lor \neg \left(t\_2 \leq 0.99999999995\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))) < -5.0000000000000001e26 or 0.99999999995 < (-.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.1%

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

              if -5.0000000000000001e26 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.99999999995

              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-*.f6455.7

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x + \cos y\right) - z \cdot \sin y \leq -5 \cdot 10^{+26} \lor \neg \left(\left(x + \cos y\right) - z \cdot \sin y \leq 0.99999999995\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: 98.8% accurate, 1.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{-6} \lor \neg \left(z \leq 1.05 \cdot 10^{-27}\right):\\ \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos y + x}{x} \cdot x\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= z -1.9e-6) (not (<= z 1.05e-27)))
               (- (+ x 1.0) (* z (sin y)))
               (* (/ (+ (cos y) x) x) x)))
            double code(double x, double y, double z) {
            	double tmp;
            	if ((z <= -1.9e-6) || !(z <= 1.05e-27)) {
            		tmp = (x + 1.0) - (z * sin(y));
            	} else {
            		tmp = ((cos(y) + x) / x) * 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.9d-6)) .or. (.not. (z <= 1.05d-27))) then
                    tmp = (x + 1.0d0) - (z * sin(y))
                else
                    tmp = ((cos(y) + x) / x) * x
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double tmp;
            	if ((z <= -1.9e-6) || !(z <= 1.05e-27)) {
            		tmp = (x + 1.0) - (z * Math.sin(y));
            	} else {
            		tmp = ((Math.cos(y) + x) / x) * x;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	tmp = 0
            	if (z <= -1.9e-6) or not (z <= 1.05e-27):
            		tmp = (x + 1.0) - (z * math.sin(y))
            	else:
            		tmp = ((math.cos(y) + x) / x) * x
            	return tmp
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((z <= -1.9e-6) || !(z <= 1.05e-27))
            		tmp = Float64(Float64(x + 1.0) - Float64(z * sin(y)));
            	else
            		tmp = Float64(Float64(Float64(cos(y) + x) / x) * x);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	tmp = 0.0;
            	if ((z <= -1.9e-6) || ~((z <= 1.05e-27)))
            		tmp = (x + 1.0) - (z * sin(y));
            	else
            		tmp = ((cos(y) + x) / x) * x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[z, -1.9e-6], N[Not[LessEqual[z, 1.05e-27]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision] / x), $MachinePrecision] * x), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -1.9 \cdot 10^{-6} \lor \neg \left(z \leq 1.05 \cdot 10^{-27}\right):\\
            \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\cos y + x}{x} \cdot x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -1.9e-6 or 1.05000000000000008e-27 < 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.8%

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

                if -1.9e-6 < z < 1.05000000000000008e-27

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                  \[\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. Applied rewrites99.7%

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

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

                      \[\leadsto \frac{\cos y + x}{x} \cdot x \]
                  4. Recombined 2 regimes into one program.
                  5. Final simplification99.4%

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

                  Alternative 5: 69.3% accurate, 1.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+161}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq -1 \cdot 10^{+29}:\\ \;\;\;\;\left(-z\right) \cdot \sin y\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{+16}:\\ \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
                  (FPCore (x y z)
                   :precision binary64
                   (if (<= y -1.85e+161)
                     (+ 1.0 x)
                     (if (<= y -1e+29)
                       (* (- z) (sin y))
                       (if (<= y 2.95e+16) (- x (fma z y -1.0)) (+ 1.0 x)))))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if (y <= -1.85e+161) {
                  		tmp = 1.0 + x;
                  	} else if (y <= -1e+29) {
                  		tmp = -z * sin(y);
                  	} else if (y <= 2.95e+16) {
                  		tmp = x - fma(z, y, -1.0);
                  	} else {
                  		tmp = 1.0 + x;
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z)
                  	tmp = 0.0
                  	if (y <= -1.85e+161)
                  		tmp = Float64(1.0 + x);
                  	elseif (y <= -1e+29)
                  		tmp = Float64(Float64(-z) * sin(y));
                  	elseif (y <= 2.95e+16)
                  		tmp = Float64(x - fma(z, y, -1.0));
                  	else
                  		tmp = Float64(1.0 + x);
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_, z_] := If[LessEqual[y, -1.85e+161], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, -1e+29], N[((-z) * N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.95e+16], N[(x - N[(z * y + -1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y \leq -1.85 \cdot 10^{+161}:\\
                  \;\;\;\;1 + x\\
                  
                  \mathbf{elif}\;y \leq -1 \cdot 10^{+29}:\\
                  \;\;\;\;\left(-z\right) \cdot \sin y\\
                  
                  \mathbf{elif}\;y \leq 2.95 \cdot 10^{+16}:\\
                  \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;1 + x\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if y < -1.8499999999999999e161 or 2.95e16 < 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-+.f6449.8

                        \[\leadsto \color{blue}{1 + x} \]
                    5. Applied rewrites49.8%

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

                    if -1.8499999999999999e161 < y < -9.99999999999999914e28

                    1. Initial program 99.7%

                      \[\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.f6453.1

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

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

                    if -9.99999999999999914e28 < y < 2.95e16

                    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 rewrites96.5%

                        \[\leadsto \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
                      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. metadata-evalN/A

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

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

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

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

                          \[\leadsto x - \left(\color{blue}{z \cdot y} + -1\right) \]
                        12. lower-fma.f6495.6

                          \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y, -1\right)} \]
                      4. Applied rewrites95.6%

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

                    Alternative 6: 88.0% accurate, 1.9× speedup?

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

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

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

                      Alternative 7: 69.7% accurate, 3.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4200 \lor \neg \left(y \leq 23\right):\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;\left(x + \mathsf{fma}\left(y \cdot y, -0.5, 1\right)\right) - \mathsf{fma}\left(z \cdot \mathsf{fma}\left(0.008333333333333333, y \cdot y, -0.16666666666666666\right), y \cdot y, z\right) \cdot y\\ \end{array} \end{array} \]
                      (FPCore (x y z)
                       :precision binary64
                       (if (or (<= y -4200.0) (not (<= y 23.0)))
                         (+ 1.0 x)
                         (-
                          (+ x (fma (* y y) -0.5 1.0))
                          (*
                           (fma
                            (* z (fma 0.008333333333333333 (* y y) -0.16666666666666666))
                            (* y y)
                            z)
                           y))))
                      double code(double x, double y, double z) {
                      	double tmp;
                      	if ((y <= -4200.0) || !(y <= 23.0)) {
                      		tmp = 1.0 + x;
                      	} else {
                      		tmp = (x + fma((y * y), -0.5, 1.0)) - (fma((z * fma(0.008333333333333333, (y * y), -0.16666666666666666)), (y * y), z) * y);
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z)
                      	tmp = 0.0
                      	if ((y <= -4200.0) || !(y <= 23.0))
                      		tmp = Float64(1.0 + x);
                      	else
                      		tmp = Float64(Float64(x + fma(Float64(y * y), -0.5, 1.0)) - Float64(fma(Float64(z * fma(0.008333333333333333, Float64(y * y), -0.16666666666666666)), Float64(y * y), z) * y));
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_] := If[Or[LessEqual[y, -4200.0], N[Not[LessEqual[y, 23.0]], $MachinePrecision]], N[(1.0 + x), $MachinePrecision], N[(N[(x + N[(N[(y * y), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * N[(0.008333333333333333 * N[(y * y), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;y \leq -4200 \lor \neg \left(y \leq 23\right):\\
                      \;\;\;\;1 + x\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\left(x + \mathsf{fma}\left(y \cdot y, -0.5, 1\right)\right) - \mathsf{fma}\left(z \cdot \mathsf{fma}\left(0.008333333333333333, y \cdot y, -0.16666666666666666\right), y \cdot y, z\right) \cdot y\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if y < -4200 or 23 < 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. lower-+.f6443.4

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

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

                        if -4200 < y < 23

                        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}{\left(1 + \frac{-1}{2} \cdot {y}^{2}\right)}\right) - z \cdot \sin y \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(x + \mathsf{fma}\left(y \cdot y, \frac{-1}{2}, 1\right)\right) - \mathsf{fma}\left(\color{blue}{\frac{1}{120} \cdot \left({y}^{2} \cdot z\right) + \frac{-1}{6} \cdot z}, {y}^{2}, z\right) \cdot y \]
                          7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

                      Alternative 8: 69.7% accurate, 4.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4200 \lor \neg \left(y \leq 30\right):\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(0.16666666666666666 \cdot \left(z \cdot y\right) - 0.5\right) \cdot y - z, y, 1 + x\right)\\ \end{array} \end{array} \]
                      (FPCore (x y z)
                       :precision binary64
                       (if (or (<= y -4200.0) (not (<= y 30.0)))
                         (+ 1.0 x)
                         (fma (- (* (- (* 0.16666666666666666 (* z y)) 0.5) y) z) y (+ 1.0 x))))
                      double code(double x, double y, double z) {
                      	double tmp;
                      	if ((y <= -4200.0) || !(y <= 30.0)) {
                      		tmp = 1.0 + x;
                      	} else {
                      		tmp = fma(((((0.16666666666666666 * (z * y)) - 0.5) * y) - z), y, (1.0 + x));
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z)
                      	tmp = 0.0
                      	if ((y <= -4200.0) || !(y <= 30.0))
                      		tmp = Float64(1.0 + x);
                      	else
                      		tmp = fma(Float64(Float64(Float64(Float64(0.16666666666666666 * Float64(z * y)) - 0.5) * y) - z), y, Float64(1.0 + x));
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_] := If[Or[LessEqual[y, -4200.0], N[Not[LessEqual[y, 30.0]], $MachinePrecision]], N[(1.0 + x), $MachinePrecision], N[(N[(N[(N[(N[(0.16666666666666666 * N[(z * y), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;y \leq -4200 \lor \neg \left(y \leq 30\right):\\
                      \;\;\;\;1 + x\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(\left(0.16666666666666666 \cdot \left(z \cdot y\right) - 0.5\right) \cdot y - z, y, 1 + x\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if y < -4200 or 30 < 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. lower-+.f6443.4

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

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

                        if -4200 < y < 30

                        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)} \]
                          7. lower--.f64N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{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(\color{blue}{\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(\color{blue}{\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(\color{blue}{\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(\color{blue}{\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 \color{blue}{\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 \color{blue}{\left(z \cdot y\right)} - \frac{1}{2}\right) \cdot y - z, y, 1 + x\right) \]
                          14. lower-+.f6499.5

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

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

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

                      Alternative 9: 69.5% accurate, 6.6× speedup?

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

                        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. lower-+.f6445.8

                            \[\leadsto \color{blue}{1 + x} \]
                        5. Applied rewrites45.8%

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

                        if -4500 < y < 5e9

                        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 rewrites99.4%

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

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

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

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

                              \[\leadsto \color{blue}{x - \left(\left(\mathsf{neg}\left(y\right)\right) \cdot \left(\frac{-1}{2} \cdot y - z\right) - 1\right)} \]
                            4. *-lft-identityN/A

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

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

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

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

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

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

                              \[\leadsto x - \left(\left(\mathsf{neg}\left(y\right)\right) \cdot \left(-1 \cdot z + \frac{-1}{2} \cdot y\right) - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot 1\right) \]
                            11. fp-cancel-sign-subN/A

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

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

                          if 5e9 < y

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

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

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

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

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

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

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

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

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

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

                            \[\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. Applied rewrites90.5%

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

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

                                \[\leadsto \frac{x - -1}{x} \cdot x \]
                            4. Recombined 3 regimes into one program.
                            5. Add Preprocessing

                            Alternative 10: 69.5% accurate, 7.6× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4500 \lor \neg \left(y \leq 5000000000\right):\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;x - \mathsf{fma}\left(\mathsf{fma}\left(0.5, y, z\right), y, -1\right)\\ \end{array} \end{array} \]
                            (FPCore (x y z)
                             :precision binary64
                             (if (or (<= y -4500.0) (not (<= y 5000000000.0)))
                               (+ 1.0 x)
                               (- x (fma (fma 0.5 y z) y -1.0))))
                            double code(double x, double y, double z) {
                            	double tmp;
                            	if ((y <= -4500.0) || !(y <= 5000000000.0)) {
                            		tmp = 1.0 + x;
                            	} else {
                            		tmp = x - fma(fma(0.5, y, z), y, -1.0);
                            	}
                            	return tmp;
                            }
                            
                            function code(x, y, z)
                            	tmp = 0.0
                            	if ((y <= -4500.0) || !(y <= 5000000000.0))
                            		tmp = Float64(1.0 + x);
                            	else
                            		tmp = Float64(x - fma(fma(0.5, y, z), y, -1.0));
                            	end
                            	return tmp
                            end
                            
                            code[x_, y_, z_] := If[Or[LessEqual[y, -4500.0], N[Not[LessEqual[y, 5000000000.0]], $MachinePrecision]], N[(1.0 + x), $MachinePrecision], N[(x - N[(N[(0.5 * y + z), $MachinePrecision] * y + -1.0), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;y \leq -4500 \lor \neg \left(y \leq 5000000000\right):\\
                            \;\;\;\;1 + x\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;x - \mathsf{fma}\left(\mathsf{fma}\left(0.5, y, z\right), y, -1\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if y < -4500 or 5e9 < 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. lower-+.f6443.6

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

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

                              if -4500 < y < 5e9

                              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 rewrites99.4%

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

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

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

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

                                    \[\leadsto \color{blue}{x - \left(\left(\mathsf{neg}\left(y\right)\right) \cdot \left(\frac{-1}{2} \cdot y - z\right) - 1\right)} \]
                                  4. *-lft-identityN/A

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

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

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

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

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

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

                                    \[\leadsto x - \left(\left(\mathsf{neg}\left(y\right)\right) \cdot \left(-1 \cdot z + \frac{-1}{2} \cdot y\right) - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot 1\right) \]
                                  11. fp-cancel-sign-subN/A

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4500 \lor \neg \left(y \leq 5000000000\right):\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;x - \mathsf{fma}\left(\mathsf{fma}\left(0.5, y, z\right), y, -1\right)\\ \end{array} \]
                              7. Add Preprocessing

                              Alternative 11: 69.5% accurate, 9.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+21} \lor \neg \left(y \leq 1000000000\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 -4.5e+21) (not (<= y 1000000000.0)))
                                 (+ 1.0 x)
                                 (- x (fma z y -1.0))))
                              double code(double x, double y, double z) {
                              	double tmp;
                              	if ((y <= -4.5e+21) || !(y <= 1000000000.0)) {
                              		tmp = 1.0 + x;
                              	} else {
                              		tmp = x - fma(z, y, -1.0);
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z)
                              	tmp = 0.0
                              	if ((y <= -4.5e+21) || !(y <= 1000000000.0))
                              		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, -4.5e+21], N[Not[LessEqual[y, 1000000000.0]], $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 -4.5 \cdot 10^{+21} \lor \neg \left(y \leq 1000000000\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 < -4.5e21 or 1e9 < 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. lower-+.f6442.1

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

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

                                if -4.5e21 < y < 1e9

                                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 rewrites98.2%

                                    \[\leadsto \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
                                  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. metadata-evalN/A

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

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

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

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

                                      \[\leadsto x - \left(\color{blue}{z \cdot y} + -1\right) \]
                                    12. lower-fma.f6497.3

                                      \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y, -1\right)} \]
                                  4. Applied rewrites97.3%

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

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

                                Alternative 12: 64.8% accurate, 10.1× speedup?

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

                                  1. Initial program 99.7%

                                    \[\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.7%

                                      \[\leadsto \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
                                    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. metadata-evalN/A

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

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

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

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

                                        \[\leadsto x - \left(\color{blue}{z \cdot y} + -1\right) \]
                                      12. lower-fma.f6458.2

                                        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, y, -1\right)} \]
                                    4. Applied rewrites58.2%

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

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

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

                                      if -4.50000000000000023e219 < z < 7.20000000000000017e189

                                      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-+.f6469.4

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

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+219} \lor \neg \left(z \leq 7.2 \cdot 10^{+189}\right):\\ \;\;\;\;x - z \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \]
                                    9. Add Preprocessing

                                    Alternative 13: 65.8% accurate, 10.1× speedup?

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

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

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

                                      if -7.80000000000000021e-11 < x < 1.11999999999999998e-119

                                      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 rewrites71.4%

                                          \[\leadsto \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
                                        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. metadata-evalN/A

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

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

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

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

                                            \[\leadsto x - \left(\color{blue}{z \cdot y} + -1\right) \]
                                          12. lower-fma.f6454.7

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

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

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

                                            \[\leadsto 1 - \color{blue}{z \cdot y} \]
                                        7. Recombined 2 regimes into one program.
                                        8. Final simplification67.3%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{-11} \lor \neg \left(x \leq 1.12 \cdot 10^{-119}\right):\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;1 - z \cdot y\\ \end{array} \]
                                        9. Add Preprocessing

                                        Alternative 14: 61.8% accurate, 15.1× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+234}:\\ \;\;\;\;\left(-y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
                                        (FPCore (x y z)
                                         :precision binary64
                                         (if (<= z -1.85e+234) (* (- y) z) (+ 1.0 x)))
                                        double code(double x, double y, double z) {
                                        	double tmp;
                                        	if (z <= -1.85e+234) {
                                        		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 <= (-1.85d+234)) 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 <= -1.85e+234) {
                                        		tmp = -y * z;
                                        	} else {
                                        		tmp = 1.0 + x;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(x, y, z):
                                        	tmp = 0
                                        	if z <= -1.85e+234:
                                        		tmp = -y * z
                                        	else:
                                        		tmp = 1.0 + x
                                        	return tmp
                                        
                                        function code(x, y, z)
                                        	tmp = 0.0
                                        	if (z <= -1.85e+234)
                                        		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 <= -1.85e+234)
                                        		tmp = -y * z;
                                        	else
                                        		tmp = 1.0 + x;
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[x_, y_, z_] := If[LessEqual[z, -1.85e+234], N[((-y) * z), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;z \leq -1.85 \cdot 10^{+234}:\\
                                        \;\;\;\;\left(-y\right) \cdot z\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;1 + x\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if z < -1.84999999999999983e234

                                          1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{z}, -0.5, -1\right), y, \frac{x - -1}{z}\right) \cdot z \]
                                            2. Taylor expanded in z around inf

                                              \[\leadsto \left(-1 \cdot y\right) \cdot z \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites47.2%

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

                                              if -1.84999999999999983e234 < z

                                              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.1

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

                                                \[\leadsto \color{blue}{1 + x} \]
                                            4. Recombined 2 regimes into one program.
                                            5. Add Preprocessing

                                            Alternative 15: 61.1% 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-+.f6462.9

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

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

                                            Alternative 16: 21.2% 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-+.f6462.9

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

                                              \[\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 2025015 
                                              (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))))