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

Percentage Accurate: 99.9% → 99.9%
Time: 4.3s
Alternatives: 9
Speedup: 1.0×

Specification

?
\[\left(x + \cos y\right) - z \cdot \sin y \]
(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]
\left(x + \cos y\right) - z \cdot \sin y

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 9 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?

\[\left(x + \cos y\right) - z \cdot \sin y \]
(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]
\left(x + \cos y\right) - z \cdot \sin y

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x - ((sin(y) * z) - cos(y))
end function
public static double code(double x, double y, double z) {
	return x - ((Math.sin(y) * z) - Math.cos(y));
}
def code(x, y, z):
	return x - ((math.sin(y) * z) - math.cos(y))
function code(x, y, z)
	return Float64(x - Float64(Float64(sin(y) * z) - cos(y)))
end
function tmp = code(x, y, z)
	tmp = x - ((sin(y) * z) - cos(y));
end
code[x_, y_, z_] := N[(x - N[(N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision] - N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \left(\sin y \cdot z - \cos y\right)
Derivation
  1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\cos y - z \cdot \sin y\right)\right)\right)} \]
    5. sub-negate-revN/A

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

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

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

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

      \[\leadsto x - \left(\color{blue}{\sin y \cdot z} - \cos y\right) \]
    10. lower-*.f6499.9%

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

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

Alternative 2: 98.8% accurate, 1.5× speedup?

\[\begin{array}{l} t_0 := \left(x + 1\right) - z \cdot \sin y\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+31}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-10}:\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (- (+ x 1.0) (* z (sin y)))))
  (if (<= z -1.7e+31) t_0 (if (<= z 1.05e-10) (+ x (cos y)) t_0))))
double code(double x, double y, double z) {
	double t_0 = (x + 1.0) - (z * sin(y));
	double tmp;
	if (z <= -1.7e+31) {
		tmp = t_0;
	} else if (z <= 1.05e-10) {
		tmp = x + cos(y);
	} else {
		tmp = t_0;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x + 1.0d0) - (z * sin(y))
    if (z <= (-1.7d+31)) then
        tmp = t_0
    else if (z <= 1.05d-10) then
        tmp = x + cos(y)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = (x + 1.0) - (z * Math.sin(y));
	double tmp;
	if (z <= -1.7e+31) {
		tmp = t_0;
	} else if (z <= 1.05e-10) {
		tmp = x + Math.cos(y);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x + 1.0) - (z * math.sin(y))
	tmp = 0
	if z <= -1.7e+31:
		tmp = t_0
	elif z <= 1.05e-10:
		tmp = x + math.cos(y)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(x + 1.0) - Float64(z * sin(y)))
	tmp = 0.0
	if (z <= -1.7e+31)
		tmp = t_0;
	elseif (z <= 1.05e-10)
		tmp = Float64(x + cos(y));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (x + 1.0) - (z * sin(y));
	tmp = 0.0;
	if (z <= -1.7e+31)
		tmp = t_0;
	elseif (z <= 1.05e-10)
		tmp = x + cos(y);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+31], t$95$0, If[LessEqual[z, 1.05e-10], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left(x + 1\right) - z \cdot \sin y\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+31}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-10}:\\
\;\;\;\;x + \cos y\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.6999999999999999e31 or 1.05e-10 < z

    1. Initial program 99.9%

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

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

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

      if -1.6999999999999999e31 < z < 1.05e-10

      1. Initial program 99.9%

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

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

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

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

          \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\cos y - z \cdot \sin y\right)\right)\right)} \]
        5. sub-negate-revN/A

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

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

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

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

          \[\leadsto x - \left(\color{blue}{\sin y \cdot z} - \cos y\right) \]
        10. lower-*.f6499.9%

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

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

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

          \[\leadsto x - \color{blue}{-1} \]
        2. Taylor expanded in z around inf

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

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

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

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

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

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

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

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

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

            \[\leadsto x + \color{blue}{\cos y} \]
          2. lower-cos.f6473.8%

            \[\leadsto x + \cos y \]
        7. Applied rewrites73.8%

          \[\leadsto \color{blue}{x + \cos y} \]
      6. Recombined 2 regimes into one program.
      7. Add Preprocessing

      Alternative 3: 98.1% accurate, 0.4× speedup?

      \[\begin{array}{l} t_0 := x + \cos y\\ t_1 := z \cdot \sin y\\ t_2 := t\_0 - t\_1\\ t_3 := x - t\_1\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+19}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 500000000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \]
      (FPCore (x y z)
        :precision binary64
        (let* ((t_0 (+ x (cos y)))
             (t_1 (* z (sin y)))
             (t_2 (- t_0 t_1))
             (t_3 (- x t_1)))
        (if (<= t_2 -2e+19) t_3 (if (<= t_2 500000000.0) t_0 t_3))))
      double code(double x, double y, double z) {
      	double t_0 = x + cos(y);
      	double t_1 = z * sin(y);
      	double t_2 = t_0 - t_1;
      	double t_3 = x - t_1;
      	double tmp;
      	if (t_2 <= -2e+19) {
      		tmp = t_3;
      	} else if (t_2 <= 500000000.0) {
      		tmp = t_0;
      	} else {
      		tmp = t_3;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8) :: t_0
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: t_3
          real(8) :: tmp
          t_0 = x + cos(y)
          t_1 = z * sin(y)
          t_2 = t_0 - t_1
          t_3 = x - t_1
          if (t_2 <= (-2d+19)) then
              tmp = t_3
          else if (t_2 <= 500000000.0d0) then
              tmp = t_0
          else
              tmp = t_3
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = x + Math.cos(y);
      	double t_1 = z * Math.sin(y);
      	double t_2 = t_0 - t_1;
      	double t_3 = x - t_1;
      	double tmp;
      	if (t_2 <= -2e+19) {
      		tmp = t_3;
      	} else if (t_2 <= 500000000.0) {
      		tmp = t_0;
      	} else {
      		tmp = t_3;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = x + math.cos(y)
      	t_1 = z * math.sin(y)
      	t_2 = t_0 - t_1
      	t_3 = x - t_1
      	tmp = 0
      	if t_2 <= -2e+19:
      		tmp = t_3
      	elif t_2 <= 500000000.0:
      		tmp = t_0
      	else:
      		tmp = t_3
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(x + cos(y))
      	t_1 = Float64(z * sin(y))
      	t_2 = Float64(t_0 - t_1)
      	t_3 = Float64(x - t_1)
      	tmp = 0.0
      	if (t_2 <= -2e+19)
      		tmp = t_3;
      	elseif (t_2 <= 500000000.0)
      		tmp = t_0;
      	else
      		tmp = t_3;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = x + cos(y);
      	t_1 = z * sin(y);
      	t_2 = t_0 - t_1;
      	t_3 = x - t_1;
      	tmp = 0.0;
      	if (t_2 <= -2e+19)
      		tmp = t_3;
      	elseif (t_2 <= 500000000.0)
      		tmp = t_0;
      	else
      		tmp = t_3;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x - t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+19], t$95$3, If[LessEqual[t$95$2, 500000000.0], t$95$0, t$95$3]]]]]]
      
      \begin{array}{l}
      t_0 := x + \cos y\\
      t_1 := z \cdot \sin y\\
      t_2 := t\_0 - t\_1\\
      t_3 := x - t\_1\\
      \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+19}:\\
      \;\;\;\;t\_3\\
      
      \mathbf{elif}\;t\_2 \leq 500000000:\\
      \;\;\;\;t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_3\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -2e19 or 5e8 < (-.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. Step-by-step derivation
          1. lift--.f64N/A

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

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

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

            \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\cos y - z \cdot \sin y\right)\right)\right)} \]
          5. sub-negate-revN/A

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

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

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

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

            \[\leadsto x - \left(\color{blue}{\sin y \cdot z} - \cos y\right) \]
          10. lower-*.f6499.9%

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

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

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

            \[\leadsto x - \color{blue}{-1} \]
          2. Taylor expanded in z around inf

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

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

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

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

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

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

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

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

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

              \[\leadsto x - z \cdot \sin y \]
            2. lower-sin.f6468.5%

              \[\leadsto x - z \cdot \sin y \]
          7. Applied rewrites68.5%

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

          if -2e19 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 5e8

          1. Initial program 99.9%

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

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

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

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

              \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\cos y - z \cdot \sin y\right)\right)\right)} \]
            5. sub-negate-revN/A

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

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

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

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

              \[\leadsto x - \left(\color{blue}{\sin y \cdot z} - \cos y\right) \]
            10. lower-*.f6499.9%

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

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

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

              \[\leadsto x - \color{blue}{-1} \]
            2. Taylor expanded in z around inf

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \color{blue}{\cos y} \]
              2. lower-cos.f6473.8%

                \[\leadsto x + \cos y \]
            7. Applied rewrites73.8%

              \[\leadsto \color{blue}{x + \cos y} \]
          6. Recombined 2 regimes into one program.
          7. Add Preprocessing

          Alternative 4: 81.2% accurate, 1.7× speedup?

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

            1. Initial program 99.9%

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

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

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

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

                \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\cos y - z \cdot \sin y\right)\right)\right)} \]
              5. sub-negate-revN/A

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

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

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

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

                \[\leadsto x - \left(\color{blue}{\sin y \cdot z} - \cos y\right) \]
              10. lower-*.f6499.9%

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

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

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

                \[\leadsto x - \color{blue}{-1} \]
              2. Taylor expanded in z around inf

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

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

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

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

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

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

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

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

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

                  \[\leadsto x + \color{blue}{\cos y} \]
                2. lower-cos.f6473.8%

                  \[\leadsto x + \cos y \]
              7. Applied rewrites73.8%

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

              if -0.34999999999999998 < y < 7.0000000000000005e-14

              1. Initial program 99.9%

                \[\left(x + \cos y\right) - z \cdot \sin y \]
              2. 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)} \]
              3. Step-by-step derivation
                1. lower-+.f64N/A

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

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

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

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

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

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

                  \[\leadsto 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) \]
                8. lower-*.f6455.2%

                  \[\leadsto 1 + \left(x + y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \left(y \cdot z\right) - 0.5\right) - z\right)\right) \]
              4. Applied rewrites55.2%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto 1 + \left(x + \left(\mathsf{fma}\left(0.16666666666666666 \cdot z, y, -0.5\right) \cdot \left(y \cdot y\right) - \color{blue}{z \cdot y}\right)\right) \]
              7. Step-by-step derivation
                1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6} \cdot z, y, \frac{-1}{2}\right) \cdot y, y, x\right) - \left(\color{blue}{z} \cdot y - 1\right) \]
                14. lower--.f6454.7%

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

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

            Alternative 5: 70.0% accurate, 2.3× speedup?

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

              1. Initial program 99.9%

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

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

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

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

                  \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\cos y - z \cdot \sin y\right)\right)\right)} \]
                5. sub-negate-revN/A

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

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

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

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

                  \[\leadsto x - \left(\color{blue}{\sin y \cdot z} - \cos y\right) \]
                10. lower-*.f6499.9%

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

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

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

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

                if -0.32000000000000001 < y < 7.0000000000000005e-14

                1. Initial program 99.9%

                  \[\left(x + \cos y\right) - z \cdot \sin y \]
                2. 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)} \]
                3. Step-by-step derivation
                  1. lower-+.f64N/A

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

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

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

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

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

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

                    \[\leadsto 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) \]
                  8. lower-*.f6455.2%

                    \[\leadsto 1 + \left(x + y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \left(y \cdot z\right) - 0.5\right) - z\right)\right) \]
                4. Applied rewrites55.2%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto 1 + \left(x + \left(\mathsf{fma}\left(0.16666666666666666 \cdot z, y, -0.5\right) \cdot \left(y \cdot y\right) - \color{blue}{z \cdot y}\right)\right) \]
                7. Step-by-step derivation
                  1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6} \cdot z, y, \frac{-1}{2}\right) \cdot y, y, x\right) - \left(\color{blue}{z} \cdot y - 1\right) \]
                  14. lower--.f6454.7%

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

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

              Alternative 6: 70.0% accurate, 2.5× speedup?

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

                1. Initial program 99.9%

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

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

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

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

                    \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\cos y - z \cdot \sin y\right)\right)\right)} \]
                  5. sub-negate-revN/A

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

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

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

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

                    \[\leadsto x - \left(\color{blue}{\sin y \cdot z} - \cos y\right) \]
                  10. lower-*.f6499.9%

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

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

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

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

                  if -0.32000000000000001 < y < 7.0000000000000005e-14

                  1. Initial program 99.9%

                    \[\left(x + \cos y\right) - z \cdot \sin y \]
                  2. 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)} \]
                  3. Step-by-step derivation
                    1. lower-+.f64N/A

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

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

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

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

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

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

                      \[\leadsto 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) \]
                    8. lower-*.f6455.2%

                      \[\leadsto 1 + \left(x + y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \left(y \cdot z\right) - 0.5\right) - z\right)\right) \]
                  4. Applied rewrites55.2%

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

                Alternative 7: 69.9% accurate, 4.7× speedup?

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

                  1. Initial program 99.9%

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

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

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

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

                      \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\cos y - z \cdot \sin y\right)\right)\right)} \]
                    5. sub-negate-revN/A

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

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

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

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

                      \[\leadsto x - \left(\color{blue}{\sin y \cdot z} - \cos y\right) \]
                    10. lower-*.f6499.9%

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

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

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

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

                    if -0.32000000000000001 < y < 7.0000000000000005e-14

                    1. Initial program 99.9%

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

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

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

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

                        \[\leadsto 1 + \left(x + -1 \cdot \color{blue}{\left(y \cdot z\right)}\right) \]
                      4. lower-*.f6464.0%

                        \[\leadsto 1 + \left(x + -1 \cdot \left(y \cdot \color{blue}{z}\right)\right) \]
                    4. Applied rewrites64.0%

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

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

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

                        \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) + 1 \]
                      4. add-flipN/A

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

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

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

                        \[\leadsto x - \left(\left(\mathsf{neg}\left(-1 \cdot \left(y \cdot z\right)\right)\right) - \left(\mathsf{neg}\left(-1\right)\right)\right) \]
                      8. add-flip-revN/A

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

                        \[\leadsto x - \left(\left(\mathsf{neg}\left(-1 \cdot \left(y \cdot z\right)\right)\right) + -1\right) \]
                      10. distribute-lft-neg-outN/A

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

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

                        \[\leadsto x - \left(y \cdot z + -1\right) \]
                      13. lift-*.f64N/A

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

                        \[\leadsto x - \left(z \cdot y + -1\right) \]
                      15. lower-fma.f6464.0%

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

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

                  Alternative 8: 62.5% accurate, 21.2× speedup?

                  \[x - -1 \]
                  (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]
                  
                  x - -1
                  
                  Derivation
                  1. Initial program 99.9%

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

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

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

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

                      \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\cos y - z \cdot \sin y\right)\right)\right)} \]
                    5. sub-negate-revN/A

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

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

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

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

                      \[\leadsto x - \left(\color{blue}{\sin y \cdot z} - \cos y\right) \]
                    10. lower-*.f6499.9%

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

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

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

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

                    Alternative 9: 43.2% accurate, 25.5× speedup?

                    \[-\left(-x\right) \]
                    (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 Float64(-Float64(-x))
                    end
                    
                    function tmp = code(x, y, z)
                    	tmp = -(-x);
                    end
                    
                    code[x_, y_, z_] := (-(-x))
                    
                    -\left(-x\right)
                    
                    Derivation
                    1. Initial program 99.9%

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

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

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

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

                        \[\leadsto 1 + \left(x + -1 \cdot \color{blue}{\left(y \cdot z\right)}\right) \]
                      4. lower-*.f6464.0%

                        \[\leadsto 1 + \left(x + -1 \cdot \left(y \cdot \color{blue}{z}\right)\right) \]
                    4. Applied rewrites64.0%

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

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

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

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

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

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

                        \[\leadsto -1 \cdot \left(z \cdot \left(y + -1 \cdot \frac{1 + x}{z}\right)\right) \]
                      6. lower-+.f6451.7%

                        \[\leadsto -1 \cdot \left(z \cdot \left(y + -1 \cdot \frac{1 + x}{z}\right)\right) \]
                    7. Applied rewrites51.7%

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

                      \[\leadsto -1 \cdot \left(-1 \cdot x\right) \]
                    9. Step-by-step derivation
                      1. lower-*.f6443.2%

                        \[\leadsto -1 \cdot \left(-1 \cdot x\right) \]
                    10. Applied rewrites43.2%

                      \[\leadsto -1 \cdot \left(-1 \cdot x\right) \]
                    11. Step-by-step derivation
                      1. lift-*.f64N/A

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

                        \[\leadsto \mathsf{neg}\left(-1 \cdot x\right) \]
                      3. lower-neg.f6443.2%

                        \[\leadsto --1 \cdot x \]
                      4. lift-*.f64N/A

                        \[\leadsto --1 \cdot x \]
                      5. mul-1-negN/A

                        \[\leadsto -\left(\mathsf{neg}\left(x\right)\right) \]
                      6. lower-neg.f6443.2%

                        \[\leadsto -\left(-x\right) \]
                    12. Applied rewrites43.2%

                      \[\leadsto -\left(-x\right) \]
                    13. Add Preprocessing

                    Reproduce

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