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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 73.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 0.99999:\\
\;\;\;\;\cos y\\

\mathbf{elif}\;t\_0 \leq 1.2 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x - -1\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x - z \cdot y\right) - -1 \]
      3. associate--l-N/A

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

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

        \[\leadsto x - \left(z \cdot y + -1\right) \]
      6. lower-fma.f6477.3

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

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

    if -2.7e12 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.999990000000000046

    1. Initial program 100.0%

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

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

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

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

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

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

      \[\leadsto \cos y \]
    7. Step-by-step derivation
      1. lift-cos.f6494.7

        \[\leadsto \cos y \]
    8. Applied rewrites94.7%

      \[\leadsto \cos y \]

    if 1.2e188 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y)))

    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. +-commutativeN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - -1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.0%

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

Alternative 3: 98.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := \left(x + \cos y\right) - t\_0\\ \mathbf{if}\;t\_1 \leq -2000000000000 \lor \neg \left(t\_1 \leq 10^{+14}\right):\\ \;\;\;\;x - t\_0\\ \mathbf{else}:\\ \;\;\;\;\cos y + x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (sin y))) (t_1 (- (+ x (cos y)) t_0)))
   (if (or (<= t_1 -2000000000000.0) (not (<= t_1 1e+14)))
     (- x t_0)
     (+ (cos y) x))))
double code(double x, double y, double z) {
	double t_0 = z * sin(y);
	double t_1 = (x + cos(y)) - t_0;
	double tmp;
	if ((t_1 <= -2000000000000.0) || !(t_1 <= 1e+14)) {
		tmp = x - t_0;
	} else {
		tmp = cos(y) + x;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = z * sin(y)
    t_1 = (x + cos(y)) - t_0
    if ((t_1 <= (-2000000000000.0d0)) .or. (.not. (t_1 <= 1d+14))) then
        tmp = x - t_0
    else
        tmp = cos(y) + x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * Math.sin(y);
	double t_1 = (x + Math.cos(y)) - t_0;
	double tmp;
	if ((t_1 <= -2000000000000.0) || !(t_1 <= 1e+14)) {
		tmp = x - t_0;
	} else {
		tmp = Math.cos(y) + x;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * math.sin(y)
	t_1 = (x + math.cos(y)) - t_0
	tmp = 0
	if (t_1 <= -2000000000000.0) or not (t_1 <= 1e+14):
		tmp = x - t_0
	else:
		tmp = math.cos(y) + x
	return tmp
function code(x, y, z)
	t_0 = Float64(z * sin(y))
	t_1 = Float64(Float64(x + cos(y)) - t_0)
	tmp = 0.0
	if ((t_1 <= -2000000000000.0) || !(t_1 <= 1e+14))
		tmp = Float64(x - t_0);
	else
		tmp = Float64(cos(y) + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * sin(y);
	t_1 = (x + cos(y)) - t_0;
	tmp = 0.0;
	if ((t_1 <= -2000000000000.0) || ~((t_1 <= 1e+14)))
		tmp = x - t_0;
	else
		tmp = cos(y) + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2000000000000.0], N[Not[LessEqual[t$95$1, 1e+14]], $MachinePrecision]], N[(x - t$95$0), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}

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

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


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

    1. Initial program 99.9%

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

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

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

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

    Alternative 4: 98.2% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := \left(x + \cos y\right) - t\_0\\ \mathbf{if}\;t\_1 \leq -2000000000000:\\ \;\;\;\;\mathsf{fma}\left(\sin y, -z, x\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+14}:\\ \;\;\;\;\cos y + x\\ \mathbf{else}:\\ \;\;\;\;x - t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (* z (sin y))) (t_1 (- (+ x (cos y)) t_0)))
       (if (<= t_1 -2000000000000.0)
         (fma (sin y) (- z) x)
         (if (<= t_1 1e+14) (+ (cos y) x) (- x t_0)))))
    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 <= -2000000000000.0) {
    		tmp = fma(sin(y), -z, x);
    	} else if (t_1 <= 1e+14) {
    		tmp = cos(y) + x;
    	} else {
    		tmp = x - t_0;
    	}
    	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 <= -2000000000000.0)
    		tmp = fma(sin(y), Float64(-z), x);
    	elseif (t_1 <= 1e+14)
    		tmp = Float64(cos(y) + x);
    	else
    		tmp = Float64(x - t_0);
    	end
    	return 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[LessEqual[t$95$1, -2000000000000.0], N[(N[Sin[y], $MachinePrecision] * (-z) + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+14], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], N[(x - t$95$0), $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 -2000000000000:\\
    \;\;\;\;\mathsf{fma}\left(\sin y, -z, x\right)\\
    
    \mathbf{elif}\;t\_1 \leq 10^{+14}:\\
    \;\;\;\;\cos y + x\\
    
    \mathbf{else}:\\
    \;\;\;\;x - t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -2e12

      1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

        1. Initial program 99.9%

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

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

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

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

        Alternative 5: 98.7% accurate, 1.0× speedup?

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

          1. Initial program 100.0%

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

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

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

            if -1 < x < 0.122

            1. Initial program 99.9%

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

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

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

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

            if 0.122 < x

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 6: 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 7: 80.7% accurate, 1.8× speedup?

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

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

              if -5.50000000000000021e206 < z < 1.44999999999999993e66

              1. Initial program 100.0%

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

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

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

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

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

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

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

            Alternative 8: 80.5% accurate, 1.8× speedup?

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

              1. Initial program 99.9%

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

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

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

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

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

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

              if -5.7999999999999996e30 < y < 0.085999999999999993

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 9: 69.3% accurate, 4.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+57} \lor \neg \left(y \leq 4.6\right):\\ \;\;\;\;x - -1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(0.16666666666666666 \cdot \left(z \cdot y\right) - 0.5\right) \cdot y - z, y, x - -1\right)\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= y -1.7e+57) (not (<= y 4.6)))
               (- x -1.0)
               (fma (- (* (- (* 0.16666666666666666 (* z y)) 0.5) y) z) y (- x -1.0))))
            double code(double x, double y, double z) {
            	double tmp;
            	if ((y <= -1.7e+57) || !(y <= 4.6)) {
            		tmp = x - -1.0;
            	} else {
            		tmp = fma(((((0.16666666666666666 * (z * y)) - 0.5) * y) - z), y, (x - -1.0));
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((y <= -1.7e+57) || !(y <= 4.6))
            		tmp = Float64(x - -1.0);
            	else
            		tmp = fma(Float64(Float64(Float64(Float64(0.16666666666666666 * Float64(z * y)) - 0.5) * y) - z), y, Float64(x - -1.0));
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[y, -1.7e+57], N[Not[LessEqual[y, 4.6]], $MachinePrecision]], N[(x - -1.0), $MachinePrecision], N[(N[(N[(N[(N[(0.16666666666666666 * N[(z * y), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(x - -1.0), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -1.7 \cdot 10^{+57} \lor \neg \left(y \leq 4.6\right):\\
            \;\;\;\;x - -1\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(\left(0.16666666666666666 \cdot \left(z \cdot y\right) - 0.5\right) \cdot y - z, y, x - -1\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -1.69999999999999996e57 or 4.5999999999999996 < 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. +-commutativeN/A

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

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

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

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

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

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

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

              if -1.69999999999999996e57 < y < 4.5999999999999996

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 10: 69.4% accurate, 5.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{+55} \lor \neg \left(y \leq 2.9 \cdot 10^{+36}\right):\\ \;\;\;\;x - -1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(0.16666666666666666 \cdot y\right) \cdot z\right) \cdot y - z, y, x - -1\right)\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= y -7.8e+55) (not (<= y 2.9e+36)))
               (- x -1.0)
               (fma (- (* (* (* 0.16666666666666666 y) z) y) z) y (- x -1.0))))
            double code(double x, double y, double z) {
            	double tmp;
            	if ((y <= -7.8e+55) || !(y <= 2.9e+36)) {
            		tmp = x - -1.0;
            	} else {
            		tmp = fma(((((0.16666666666666666 * y) * z) * y) - z), y, (x - -1.0));
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((y <= -7.8e+55) || !(y <= 2.9e+36))
            		tmp = Float64(x - -1.0);
            	else
            		tmp = fma(Float64(Float64(Float64(Float64(0.16666666666666666 * y) * z) * y) - z), y, Float64(x - -1.0));
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[y, -7.8e+55], N[Not[LessEqual[y, 2.9e+36]], $MachinePrecision]], N[(x - -1.0), $MachinePrecision], N[(N[(N[(N[(N[(0.16666666666666666 * y), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(x - -1.0), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -7.8 \cdot 10^{+55} \lor \neg \left(y \leq 2.9 \cdot 10^{+36}\right):\\
            \;\;\;\;x - -1\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(\left(\left(0.16666666666666666 \cdot y\right) \cdot z\right) \cdot y - z, y, x - -1\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -7.80000000000000054e55 or 2.9e36 < 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. +-commutativeN/A

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

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

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

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

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

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

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

              if -7.80000000000000054e55 < y < 2.9e36

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(\frac{1}{6} \cdot \left(y \cdot z\right)\right) \cdot y - z, y, x - -1\right) \]
              7. Step-by-step derivation
                1. associate-*r*N/A

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

                  \[\leadsto \mathsf{fma}\left(\left(\left(\frac{1}{6} \cdot y\right) \cdot z\right) \cdot y - z, y, x - -1\right) \]
                3. lower-*.f6491.9

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

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

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

            Alternative 11: 69.7% accurate, 7.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+32} \lor \neg \left(y \leq 4.6\right):\\ \;\;\;\;x - -1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, x - -1\right)\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= y -1.25e+32) (not (<= y 4.6)))
               (- x -1.0)
               (fma (- (* -0.5 y) z) y (- x -1.0))))
            double code(double x, double y, double z) {
            	double tmp;
            	if ((y <= -1.25e+32) || !(y <= 4.6)) {
            		tmp = x - -1.0;
            	} else {
            		tmp = fma(((-0.5 * y) - z), y, (x - -1.0));
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((y <= -1.25e+32) || !(y <= 4.6))
            		tmp = Float64(x - -1.0);
            	else
            		tmp = fma(Float64(Float64(-0.5 * y) - z), y, Float64(x - -1.0));
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[y, -1.25e+32], N[Not[LessEqual[y, 4.6]], $MachinePrecision]], N[(x - -1.0), $MachinePrecision], N[(N[(N[(-0.5 * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(x - -1.0), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -1.25 \cdot 10^{+32} \lor \neg \left(y \leq 4.6\right):\\
            \;\;\;\;x - -1\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, x - -1\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -1.2499999999999999e32 or 4.5999999999999996 < 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. +-commutativeN/A

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

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

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

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

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

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

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

              if -1.2499999999999999e32 < y < 4.5999999999999996

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot y - z, y, x - -1\right) \]
                14. lower--.f6498.3

                  \[\leadsto \mathsf{fma}\left(-0.5 \cdot y - z, y, x - -1\right) \]
              5. Applied rewrites98.3%

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

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

            Alternative 12: 69.6% accurate, 9.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+51} \lor \neg \left(y \leq 1.7 \cdot 10^{+26}\right):\\ \;\;\;\;x - -1\\ \mathbf{else}:\\ \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= y -2e+51) (not (<= y 1.7e+26))) (- x -1.0) (- x (fma z y -1.0))))
            double code(double x, double y, double z) {
            	double tmp;
            	if ((y <= -2e+51) || !(y <= 1.7e+26)) {
            		tmp = x - -1.0;
            	} else {
            		tmp = x - fma(z, y, -1.0);
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((y <= -2e+51) || !(y <= 1.7e+26))
            		tmp = Float64(x - -1.0);
            	else
            		tmp = Float64(x - fma(z, y, -1.0));
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[y, -2e+51], N[Not[LessEqual[y, 1.7e+26]], $MachinePrecision]], N[(x - -1.0), $MachinePrecision], N[(x - N[(z * y + -1.0), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -2 \cdot 10^{+51} \lor \neg \left(y \leq 1.7 \cdot 10^{+26}\right):\\
            \;\;\;\;x - -1\\
            
            \mathbf{else}:\\
            \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -2e51 or 1.7000000000000001e26 < 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. +-commutativeN/A

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

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

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

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

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

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

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

              if -2e51 < y < 1.7000000000000001e26

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(x - z \cdot y\right) - -1 \]
                3. associate--l-N/A

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

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

                  \[\leadsto x - \left(z \cdot y + -1\right) \]
                6. lower-fma.f6494.0

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

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

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

            Alternative 13: 66.2% accurate, 10.1× speedup?

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

              1. Initial program 100.0%

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

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

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

                if -5.5e16 < x < 9.5e6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto 1 - \color{blue}{y \cdot z} \]
                7. Step-by-step derivation
                  1. lower--.f64N/A

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

                    \[\leadsto 1 - z \cdot y \]
                  3. lift-*.f6456.2

                    \[\leadsto 1 - z \cdot y \]
                8. Applied rewrites56.2%

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

                if 9.5e6 < x

                1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

              Alternative 14: 61.9% accurate, 15.1× speedup?

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

                1. Initial program 99.9%

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

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

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

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

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

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

                    \[\leadsto x - -1 \]
                  6. lower--.f6466.4

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

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

                if 2.5999999999999998e212 < z

                1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-z\right) \cdot y \]
                8. Recombined 2 regimes into one program.
                9. Add Preprocessing

                Alternative 15: 61.4% accurate, 53.0× speedup?

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

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

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

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

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

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

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

                    \[\leadsto x - -1 \]
                  6. lower--.f6462.3

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

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

                Alternative 16: 42.2% accurate, 212.0× speedup?

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

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

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

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

                  Reproduce

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