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

Percentage Accurate: 99.9% → 99.9%
Time: 6.8s
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.4% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := \left(x + 1\right) - t\_0\\ \mathbf{if}\;x \leq \frac{-1098878309078401}{9007199254740992}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq \frac{4842270319348757}{2305843009213693952}:\\ \;\;\;\;\cos y - t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (* z (sin y))) (t_1 (- (+ x 1) t_0)))
  (if (<= x -1098878309078401/9007199254740992)
    t_1
    (if (<= x 4842270319348757/2305843009213693952)
      (- (cos y) t_0)
      t_1))))
double code(double x, double y, double z) {
	double t_0 = z * sin(y);
	double t_1 = (x + 1.0) - t_0;
	double tmp;
	if (x <= -0.122) {
		tmp = t_1;
	} else if (x <= 0.0021) {
		tmp = cos(y) - t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{elif}\;x \leq \frac{4842270319348757}{2305843009213693952}:\\
\;\;\;\;\cos y - t\_0\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.122 or 0.0020999999999999999 < x

    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.3%

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

      if -0.122 < x < 0.0020999999999999999

      1. Initial program 99.9%

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

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

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

        \[\leadsto \color{blue}{\cos y} - z \cdot \sin y \]
    4. Recombined 2 regimes into one program.
    5. Add Preprocessing

    Alternative 2: 99.1% accurate, 1.7× speedup?

    \[\begin{array}{l} t_0 := \left(x + 1\right) - z \cdot \sin y\\ \mathbf{if}\;z \leq -180000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 2500:\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
    (FPCore (x y z)
      :precision binary64
      (let* ((t_0 (- (+ x 1) (* z (sin y)))))
      (if (<= z -180000) t_0 (if (<= z 2500) (+ 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 <= -180000.0) {
    		tmp = t_0;
    	} else if (z <= 2500.0) {
    		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 <= (-180000.0d0)) then
            tmp = t_0
        else if (z <= 2500.0d0) 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 <= -180000.0) {
    		tmp = t_0;
    	} else if (z <= 2500.0) {
    		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 <= -180000.0:
    		tmp = t_0
    	elif z <= 2500.0:
    		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 <= -180000.0)
    		tmp = t_0;
    	elseif (z <= 2500.0)
    		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 <= -180000.0)
    		tmp = t_0;
    	elseif (z <= 2500.0)
    		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), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -180000], t$95$0, If[LessEqual[z, 2500], 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 -180000:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq 2500:\\
    \;\;\;\;x + \cos y\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.8e5 or 2500 < 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.3%

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

        if -1.8e5 < z < 2500

        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-*.f6463.6%

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

          \[\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. add-flipN/A

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

            \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - -1 \]
          5. lower--.f6463.6%

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

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

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

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

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

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

            \[\leadsto \left(x - 1 \cdot \left(y \cdot z\right)\right) - -1 \]
          12. *-lft-identity63.6%

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

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

            \[\leadsto \left(x - z \cdot y\right) - -1 \]
          15. lower-*.f6463.6%

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

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

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

            \[\leadsto 1 - y \cdot \color{blue}{z} \]
          2. lower-*.f6428.8%

            \[\leadsto 1 - y \cdot z \]
        9. Applied rewrites28.8%

          \[\leadsto 1 - \color{blue}{y \cdot z} \]
        10. Taylor expanded in z around 0

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

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

            \[\leadsto x + \cos y \]
        12. Applied rewrites72.7%

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

      Alternative 3: 82.0% accurate, 1.6× speedup?

      \[\begin{array}{l} t_0 := -1 \cdot \left(z \cdot \sin y\right)\\ \mathbf{if}\;z \leq -40000000000000002391323129842064607406997161009352362834945437993288032823004523745242241364266405613782727968977294165463537811456:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 230000000000000004443498729351904554905501696:\\ \;\;\;\;x + \cos y\\ \mathbf{elif}\;z \leq 195000000000000002277179190768144145496795764669256648392777950829287667760926744492748524430463593883754955609273017061957799237916241279678540485986708696505930733215055440258537551273394176:\\ \;\;\;\;\left(x - z \cdot y\right) - -1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
      (FPCore (x y z)
        :precision binary64
        (let* ((t_0 (* -1 (* z (sin y)))))
        (if (<=
             z
             -40000000000000002391323129842064607406997161009352362834945437993288032823004523745242241364266405613782727968977294165463537811456)
          t_0
          (if (<= z 230000000000000004443498729351904554905501696)
            (+ x (cos y))
            (if (<=
                 z
                 195000000000000002277179190768144145496795764669256648392777950829287667760926744492748524430463593883754955609273017061957799237916241279678540485986708696505930733215055440258537551273394176)
              (- (- x (* z y)) -1)
              t_0)))))
      double code(double x, double y, double z) {
      	double t_0 = -1.0 * (z * sin(y));
      	double tmp;
      	if (z <= -4e+130) {
      		tmp = t_0;
      	} else if (z <= 2.3e+44) {
      		tmp = x + cos(y);
      	} else if (z <= 1.95e+191) {
      		tmp = (x - (z * y)) - -1.0;
      	} 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 = (-1.0d0) * (z * sin(y))
          if (z <= (-4d+130)) then
              tmp = t_0
          else if (z <= 2.3d+44) then
              tmp = x + cos(y)
          else if (z <= 1.95d+191) then
              tmp = (x - (z * y)) - (-1.0d0)
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = -1.0 * (z * Math.sin(y));
      	double tmp;
      	if (z <= -4e+130) {
      		tmp = t_0;
      	} else if (z <= 2.3e+44) {
      		tmp = x + Math.cos(y);
      	} else if (z <= 1.95e+191) {
      		tmp = (x - (z * y)) - -1.0;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = -1.0 * (z * math.sin(y))
      	tmp = 0
      	if z <= -4e+130:
      		tmp = t_0
      	elif z <= 2.3e+44:
      		tmp = x + math.cos(y)
      	elif z <= 1.95e+191:
      		tmp = (x - (z * y)) - -1.0
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(-1.0 * Float64(z * sin(y)))
      	tmp = 0.0
      	if (z <= -4e+130)
      		tmp = t_0;
      	elseif (z <= 2.3e+44)
      		tmp = Float64(x + cos(y));
      	elseif (z <= 1.95e+191)
      		tmp = Float64(Float64(x - Float64(z * y)) - -1.0);
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = -1.0 * (z * sin(y));
      	tmp = 0.0;
      	if (z <= -4e+130)
      		tmp = t_0;
      	elseif (z <= 2.3e+44)
      		tmp = x + cos(y);
      	elseif (z <= 1.95e+191)
      		tmp = (x - (z * y)) - -1.0;
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(-1 * N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -40000000000000002391323129842064607406997161009352362834945437993288032823004523745242241364266405613782727968977294165463537811456], t$95$0, If[LessEqual[z, 230000000000000004443498729351904554905501696], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 195000000000000002277179190768144145496795764669256648392777950829287667760926744492748524430463593883754955609273017061957799237916241279678540485986708696505930733215055440258537551273394176], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] - -1), $MachinePrecision], t$95$0]]]]
      
      \begin{array}{l}
      t_0 := -1 \cdot \left(z \cdot \sin y\right)\\
      \mathbf{if}\;z \leq -40000000000000002391323129842064607406997161009352362834945437993288032823004523745242241364266405613782727968977294165463537811456:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;z \leq 230000000000000004443498729351904554905501696:\\
      \;\;\;\;x + \cos y\\
      
      \mathbf{elif}\;z \leq 195000000000000002277179190768144145496795764669256648392777950829287667760926744492748524430463593883754955609273017061957799237916241279678540485986708696505930733215055440258537551273394176:\\
      \;\;\;\;\left(x - z \cdot y\right) - -1\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if z < -4.0000000000000002e130 or 1.95e191 < z

        1. Initial program 99.9%

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

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

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

            \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\sin y}\right) \]
          3. lower-sin.f6428.6%

            \[\leadsto -1 \cdot \left(z \cdot \sin y\right) \]
        4. Applied rewrites28.6%

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

        if -4.0000000000000002e130 < z < 2.3e44

        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-*.f6463.6%

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

          \[\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. add-flipN/A

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

            \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - -1 \]
          5. lower--.f6463.6%

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

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

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

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

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

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

            \[\leadsto \left(x - 1 \cdot \left(y \cdot z\right)\right) - -1 \]
          12. *-lft-identity63.6%

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

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

            \[\leadsto \left(x - z \cdot y\right) - -1 \]
          15. lower-*.f6463.6%

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

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

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

            \[\leadsto 1 - y \cdot \color{blue}{z} \]
          2. lower-*.f6428.8%

            \[\leadsto 1 - y \cdot z \]
        9. Applied rewrites28.8%

          \[\leadsto 1 - \color{blue}{y \cdot z} \]
        10. Taylor expanded in z around 0

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

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

            \[\leadsto x + \cos y \]
        12. Applied rewrites72.7%

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

        if 2.3e44 < z < 1.95e191

        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-*.f6463.6%

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

          \[\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. add-flipN/A

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

            \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - -1 \]
          5. lower--.f6463.6%

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

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

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

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

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

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

            \[\leadsto \left(x - 1 \cdot \left(y \cdot z\right)\right) - -1 \]
          12. *-lft-identity63.6%

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

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

            \[\leadsto \left(x - z \cdot y\right) - -1 \]
          15. lower-*.f6463.6%

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

          \[\leadsto \left(x - z \cdot y\right) - \color{blue}{-1} \]
      3. Recombined 3 regimes into one program.
      4. Add Preprocessing

      Alternative 4: 80.4% accurate, 1.8× speedup?

      \[\begin{array}{l} t_0 := x + \cos y\\ \mathbf{if}\;y \leq -63:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq \frac{3775007508029161}{5316911983139663491615228241121378304}:\\ \;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right)\right) - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
      (FPCore (x y z)
        :precision binary64
        (let* ((t_0 (+ x (cos y))))
        (if (<= y -63)
          t_0
          (if (<= y 3775007508029161/5316911983139663491615228241121378304)
            (+ 1 (+ x (* y (- (* y (* 1/6 (* y z))) z))))
            t_0))))
      double code(double x, double y, double z) {
      	double t_0 = x + cos(y);
      	double tmp;
      	if (y <= -63.0) {
      		tmp = t_0;
      	} else if (y <= 7.1e-22) {
      		tmp = 1.0 + (x + (y * ((y * (0.16666666666666666 * (y * z))) - z)));
      	} 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 + cos(y)
          if (y <= (-63.0d0)) then
              tmp = t_0
          else if (y <= 7.1d-22) then
              tmp = 1.0d0 + (x + (y * ((y * (0.16666666666666666d0 * (y * z))) - z)))
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = x + Math.cos(y);
      	double tmp;
      	if (y <= -63.0) {
      		tmp = t_0;
      	} else if (y <= 7.1e-22) {
      		tmp = 1.0 + (x + (y * ((y * (0.16666666666666666 * (y * z))) - z)));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = x + math.cos(y)
      	tmp = 0
      	if y <= -63.0:
      		tmp = t_0
      	elif y <= 7.1e-22:
      		tmp = 1.0 + (x + (y * ((y * (0.16666666666666666 * (y * z))) - z)))
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(x + cos(y))
      	tmp = 0.0
      	if (y <= -63.0)
      		tmp = t_0;
      	elseif (y <= 7.1e-22)
      		tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(0.16666666666666666 * Float64(y * z))) - z))));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = x + cos(y);
      	tmp = 0.0;
      	if (y <= -63.0)
      		tmp = t_0;
      	elseif (y <= 7.1e-22)
      		tmp = 1.0 + (x + (y * ((y * (0.16666666666666666 * (y * z))) - z)));
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -63], t$95$0, If[LessEqual[y, 3775007508029161/5316911983139663491615228241121378304], N[(1 + N[(x + N[(y * N[(N[(y * N[(1/6 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      t_0 := x + \cos y\\
      \mathbf{if}\;y \leq -63:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;y \leq \frac{3775007508029161}{5316911983139663491615228241121378304}:\\
      \;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right)\right) - z\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -63 or 7.0999999999999999e-22 < y

        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-*.f6463.6%

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

          \[\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. add-flipN/A

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

            \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - -1 \]
          5. lower--.f6463.6%

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

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

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

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

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

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

            \[\leadsto \left(x - 1 \cdot \left(y \cdot z\right)\right) - -1 \]
          12. *-lft-identity63.6%

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

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

            \[\leadsto \left(x - z \cdot y\right) - -1 \]
          15. lower-*.f6463.6%

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

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

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

            \[\leadsto 1 - y \cdot \color{blue}{z} \]
          2. lower-*.f6428.8%

            \[\leadsto 1 - y \cdot z \]
        9. Applied rewrites28.8%

          \[\leadsto 1 - \color{blue}{y \cdot z} \]
        10. Taylor expanded in z around 0

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

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

            \[\leadsto x + \cos y \]
        12. Applied rewrites72.7%

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

        if -63 < y < 7.0999999999999999e-22

        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-*.f6454.7%

            \[\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) \]
        4. Applied rewrites54.7%

          \[\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)} \]
        5. Taylor expanded in z around inf

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

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

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

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

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

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

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

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

            \[\leadsto 1 + \left(x + y \cdot \left(y \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right)\right) - z\right)\right) \]
          2. lower-*.f6455.9%

            \[\leadsto 1 + \left(x + y \cdot \left(y \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right)\right) - z\right)\right) \]
        10. Applied rewrites55.9%

          \[\leadsto 1 + \left(x + y \cdot \left(y \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right)\right) - z\right)\right) \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 5: 67.0% accurate, 10.6× speedup?

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

        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-*.f6463.6%

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

          \[\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. add-flipN/A

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

            \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - -1 \]
          5. lower--.f6463.6%

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

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

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

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

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

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

            \[\leadsto \left(x - 1 \cdot \left(y \cdot z\right)\right) - -1 \]
          12. *-lft-identity63.6%

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

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

            \[\leadsto \left(x - z \cdot y\right) - -1 \]
          15. lower-*.f6463.6%

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

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

        if 2.1000000000000001e40 < y

        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-*.f6463.6%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto -1 \cdot \left(-1 \cdot \left(1 + x\right)\right) \]
          2. lower-+.f6461.6%

            \[\leadsto -1 \cdot \left(-1 \cdot \left(1 + x\right)\right) \]
        10. Applied rewrites61.6%

          \[\leadsto -1 \cdot \left(-1 \cdot \left(1 + \color{blue}{x}\right)\right) \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 6: 66.4% accurate, 11.8× speedup?

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

        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-*.f6463.6%

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

          \[\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. add-flipN/A

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

            \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - -1 \]
          5. lower--.f6463.6%

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

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

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

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

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

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

            \[\leadsto \left(x - 1 \cdot \left(y \cdot z\right)\right) - -1 \]
          12. *-lft-identity63.6%

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

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

            \[\leadsto \left(x - z \cdot y\right) - -1 \]
          15. lower-*.f6463.6%

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

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

        if 6.8000000000000004e94 < y

        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-*.f6463.6%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -1 \cdot \left(-1 \cdot x\right) \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 7: 66.3% accurate, 9.2× speedup?

      \[\begin{array}{l} t_0 := -1 \cdot \left(-1 \cdot x\right)\\ \mathbf{if}\;x \leq -24000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 40000000:\\ \;\;\;\;1 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
      (FPCore (x y z)
        :precision binary64
        (let* ((t_0 (* -1 (* -1 x))))
        (if (<= x -24000000000) t_0 (if (<= x 40000000) (- 1 (* y z)) t_0))))
      double code(double x, double y, double z) {
      	double t_0 = -1.0 * (-1.0 * x);
      	double tmp;
      	if (x <= -24000000000.0) {
      		tmp = t_0;
      	} else if (x <= 40000000.0) {
      		tmp = 1.0 - (y * z);
      	} 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 = (-1.0d0) * ((-1.0d0) * x)
          if (x <= (-24000000000.0d0)) then
              tmp = t_0
          else if (x <= 40000000.0d0) then
              tmp = 1.0d0 - (y * z)
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = -1.0 * (-1.0 * x);
      	double tmp;
      	if (x <= -24000000000.0) {
      		tmp = t_0;
      	} else if (x <= 40000000.0) {
      		tmp = 1.0 - (y * z);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = -1.0 * (-1.0 * x)
      	tmp = 0
      	if x <= -24000000000.0:
      		tmp = t_0
      	elif x <= 40000000.0:
      		tmp = 1.0 - (y * z)
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(-1.0 * Float64(-1.0 * x))
      	tmp = 0.0
      	if (x <= -24000000000.0)
      		tmp = t_0;
      	elseif (x <= 40000000.0)
      		tmp = Float64(1.0 - Float64(y * z));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = -1.0 * (-1.0 * x);
      	tmp = 0.0;
      	if (x <= -24000000000.0)
      		tmp = t_0;
      	elseif (x <= 40000000.0)
      		tmp = 1.0 - (y * z);
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(-1 * N[(-1 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -24000000000], t$95$0, If[LessEqual[x, 40000000], N[(1 - N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      t_0 := -1 \cdot \left(-1 \cdot x\right)\\
      \mathbf{if}\;x \leq -24000000000:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x \leq 40000000:\\
      \;\;\;\;1 - y \cdot z\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -2.4e10 or 4e7 < x

        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-*.f6463.6%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -1 \cdot \left(-1 \cdot x\right) \]

        if -2.4e10 < x < 4e7

        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-*.f6463.6%

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

          \[\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. add-flipN/A

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

            \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - -1 \]
          5. lower--.f6463.6%

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

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

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

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

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

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

            \[\leadsto \left(x - 1 \cdot \left(y \cdot z\right)\right) - -1 \]
          12. *-lft-identity63.6%

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

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

            \[\leadsto \left(x - z \cdot y\right) - -1 \]
          15. lower-*.f6463.6%

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

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

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

            \[\leadsto 1 - y \cdot \color{blue}{z} \]
          2. lower-*.f6428.8%

            \[\leadsto 1 - y \cdot z \]
        9. Applied rewrites28.8%

          \[\leadsto 1 - \color{blue}{y \cdot z} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 8: 28.8% accurate, 23.6× speedup?

      \[1 - y \cdot z \]
      (FPCore (x y z)
        :precision binary64
        (- 1 (* y z)))
      double code(double x, double y, double z) {
      	return 1.0 - (y * z);
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          code = 1.0d0 - (y * z)
      end function
      
      public static double code(double x, double y, double z) {
      	return 1.0 - (y * z);
      }
      
      def code(x, y, z):
      	return 1.0 - (y * z)
      
      function code(x, y, z)
      	return Float64(1.0 - Float64(y * z))
      end
      
      function tmp = code(x, y, z)
      	tmp = 1.0 - (y * z);
      end
      
      code[x_, y_, z_] := N[(1 - N[(y * z), $MachinePrecision]), $MachinePrecision]
      
      1 - y \cdot z
      
      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-*.f6463.6%

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

        \[\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. add-flipN/A

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

          \[\leadsto \left(x + -1 \cdot \left(y \cdot z\right)\right) - -1 \]
        5. lower--.f6463.6%

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

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

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

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

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

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

          \[\leadsto \left(x - 1 \cdot \left(y \cdot z\right)\right) - -1 \]
        12. *-lft-identity63.6%

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

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

          \[\leadsto \left(x - z \cdot y\right) - -1 \]
        15. lower-*.f6463.6%

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

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

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

          \[\leadsto 1 - y \cdot \color{blue}{z} \]
        2. lower-*.f6428.8%

          \[\leadsto 1 - y \cdot z \]
      9. Applied rewrites28.8%

        \[\leadsto 1 - \color{blue}{y \cdot z} \]
      10. Add Preprocessing

      Reproduce

      ?
      herbie shell --seed 2025271 -o generate:evaluate
      (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))))