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

Percentage Accurate: 99.9% → 99.9%
Time: 7.0s
Alternatives: 14
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(x + \cos y\right) - z \cdot \sin y \end{array} \]
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
	return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
	return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z):
	return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z)
	return Float64(Float64(x + cos(y)) - Float64(z * sin(y)))
end
function tmp = code(x, y, z)
	tmp = (x + cos(y)) - (z * sin(y));
end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x + \cos y\right) - z \cdot \sin y \end{array} \]
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
	return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
	return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z):
	return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z)
	return Float64(Float64(x + cos(y)) - Float64(z * sin(y)))
end
function tmp = code(x, y, z)
	tmp = (x + cos(y)) - (z * sin(y));
end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x + \cos y\right) - z \cdot \sin y \end{array} \]
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
	return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
	return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z):
	return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z)
	return Float64(Float64(x + cos(y)) - Float64(z * sin(y)))
end
function tmp = code(x, y, z)
	tmp = (x + cos(y)) - (z * sin(y));
end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

Alternative 2: 98.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := \left(x + \cos y\right) - t\_0\\ \mathbf{if}\;t\_1 \leq -5000000000000 \lor \neg \left(t\_1 \leq 0.9998\right):\\ \;\;\;\;\left(x + 1\right) - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos y + x}{z} \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (sin y))) (t_1 (- (+ x (cos y)) t_0)))
   (if (or (<= t_1 -5000000000000.0) (not (<= t_1 0.9998)))
     (- (+ x 1.0) t_0)
     (* (/ (+ (cos y) x) z) z))))
double code(double x, double y, double z) {
	double t_0 = z * sin(y);
	double t_1 = (x + cos(y)) - t_0;
	double tmp;
	if ((t_1 <= -5000000000000.0) || !(t_1 <= 0.9998)) {
		tmp = (x + 1.0) - t_0;
	} else {
		tmp = ((cos(y) + x) / z) * z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = z * sin(y)
    t_1 = (x + cos(y)) - t_0
    if ((t_1 <= (-5000000000000.0d0)) .or. (.not. (t_1 <= 0.9998d0))) then
        tmp = (x + 1.0d0) - t_0
    else
        tmp = ((cos(y) + x) / z) * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * Math.sin(y);
	double t_1 = (x + Math.cos(y)) - t_0;
	double tmp;
	if ((t_1 <= -5000000000000.0) || !(t_1 <= 0.9998)) {
		tmp = (x + 1.0) - t_0;
	} else {
		tmp = ((Math.cos(y) + x) / z) * z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * math.sin(y)
	t_1 = (x + math.cos(y)) - t_0
	tmp = 0
	if (t_1 <= -5000000000000.0) or not (t_1 <= 0.9998):
		tmp = (x + 1.0) - t_0
	else:
		tmp = ((math.cos(y) + x) / z) * z
	return tmp
function code(x, y, z)
	t_0 = Float64(z * sin(y))
	t_1 = Float64(Float64(x + cos(y)) - t_0)
	tmp = 0.0
	if ((t_1 <= -5000000000000.0) || !(t_1 <= 0.9998))
		tmp = Float64(Float64(x + 1.0) - t_0);
	else
		tmp = Float64(Float64(Float64(cos(y) + x) / z) * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * sin(y);
	t_1 = (x + cos(y)) - t_0;
	tmp = 0.0;
	if ((t_1 <= -5000000000000.0) || ~((t_1 <= 0.9998)))
		tmp = (x + 1.0) - t_0;
	else
		tmp = ((cos(y) + x) / z) * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5000000000000.0], N[Not[LessEqual[t$95$1, 0.9998]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision] / z), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\frac{\cos y + x}{z} \cdot z\\


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

    1. Initial program 99.9%

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

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

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

      if -5e12 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.99980000000000002

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot z \]
      7. Step-by-step derivation
        1. Applied rewrites3.6%

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

          \[\leadsto \frac{x + \cos y}{z} \cdot z \]
        3. Step-by-step derivation
          1. Applied rewrites99.8%

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

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

        Alternative 3: 91.1% accurate, 0.4× speedup?

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

          1. Initial program 99.9%

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

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

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

            if -4.00000000000000006e43 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.599999999999999978

            1. Initial program 100.0%

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

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

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

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

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

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

          Alternative 4: 90.3% accurate, 0.4× speedup?

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

            1. Initial program 99.9%

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

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

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

              if -9.99999999999999914e28 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.599999999999999978

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

            Alternative 5: 99.2% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \sin y\\ \mathbf{if}\;x \leq -1.85 \cdot 10^{-14} \lor \neg \left(x \leq 6.2 \cdot 10^{-12}\right):\\ \;\;\;\;\left(x + 1\right) - t\_0\\ \mathbf{else}:\\ \;\;\;\;\cos y - t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (* z (sin y))))
               (if (or (<= x -1.85e-14) (not (<= x 6.2e-12)))
                 (- (+ x 1.0) t_0)
                 (- (cos y) t_0))))
            double code(double x, double y, double z) {
            	double t_0 = z * sin(y);
            	double tmp;
            	if ((x <= -1.85e-14) || !(x <= 6.2e-12)) {
            		tmp = (x + 1.0) - t_0;
            	} else {
            		tmp = cos(y) - t_0;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: t_0
                real(8) :: tmp
                t_0 = z * sin(y)
                if ((x <= (-1.85d-14)) .or. (.not. (x <= 6.2d-12))) then
                    tmp = (x + 1.0d0) - t_0
                else
                    tmp = cos(y) - t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = z * Math.sin(y);
            	double tmp;
            	if ((x <= -1.85e-14) || !(x <= 6.2e-12)) {
            		tmp = (x + 1.0) - t_0;
            	} else {
            		tmp = Math.cos(y) - t_0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = z * math.sin(y)
            	tmp = 0
            	if (x <= -1.85e-14) or not (x <= 6.2e-12):
            		tmp = (x + 1.0) - t_0
            	else:
            		tmp = math.cos(y) - t_0
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(z * sin(y))
            	tmp = 0.0
            	if ((x <= -1.85e-14) || !(x <= 6.2e-12))
            		tmp = Float64(Float64(x + 1.0) - t_0);
            	else
            		tmp = Float64(cos(y) - t_0);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = z * sin(y);
            	tmp = 0.0;
            	if ((x <= -1.85e-14) || ~((x <= 6.2e-12)))
            		tmp = (x + 1.0) - t_0;
            	else
            		tmp = cos(y) - t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -1.85e-14], N[Not[LessEqual[x, 6.2e-12]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := z \cdot \sin y\\
            \mathbf{if}\;x \leq -1.85 \cdot 10^{-14} \lor \neg \left(x \leq 6.2 \cdot 10^{-12}\right):\\
            \;\;\;\;\left(x + 1\right) - t\_0\\
            
            \mathbf{else}:\\
            \;\;\;\;\cos y - t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -1.85000000000000001e-14 or 6.2000000000000002e-12 < x

              1. Initial program 100.0%

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

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

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

                if -1.85000000000000001e-14 < x < 6.2000000000000002e-12

                1. Initial program 99.8%

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

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

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

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

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

              Alternative 6: 99.3% accurate, 1.6× speedup?

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

                1. Initial program 99.8%

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

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

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

                  if -1.19999999999999996 < z < 7.4999999999999996e-14

                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 7: 71.7% accurate, 1.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+161} \lor \neg \left(z \leq 9.5 \cdot 10^{+176}\right):\\ \;\;\;\;\left(-z\right) \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
                  (FPCore (x y z)
                   :precision binary64
                   (if (or (<= z -5.5e+161) (not (<= z 9.5e+176))) (* (- z) (sin y)) (+ 1.0 x)))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if ((z <= -5.5e+161) || !(z <= 9.5e+176)) {
                  		tmp = -z * sin(y);
                  	} else {
                  		tmp = 1.0 + x;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(x, y, z)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8) :: tmp
                      if ((z <= (-5.5d+161)) .or. (.not. (z <= 9.5d+176))) then
                          tmp = -z * sin(y)
                      else
                          tmp = 1.0d0 + x
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	double tmp;
                  	if ((z <= -5.5e+161) || !(z <= 9.5e+176)) {
                  		tmp = -z * Math.sin(y);
                  	} else {
                  		tmp = 1.0 + x;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z):
                  	tmp = 0
                  	if (z <= -5.5e+161) or not (z <= 9.5e+176):
                  		tmp = -z * math.sin(y)
                  	else:
                  		tmp = 1.0 + x
                  	return tmp
                  
                  function code(x, y, z)
                  	tmp = 0.0
                  	if ((z <= -5.5e+161) || !(z <= 9.5e+176))
                  		tmp = Float64(Float64(-z) * sin(y));
                  	else
                  		tmp = Float64(1.0 + x);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z)
                  	tmp = 0.0;
                  	if ((z <= -5.5e+161) || ~((z <= 9.5e+176)))
                  		tmp = -z * sin(y);
                  	else
                  		tmp = 1.0 + x;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_] := If[Or[LessEqual[z, -5.5e+161], N[Not[LessEqual[z, 9.5e+176]], $MachinePrecision]], N[((-z) * N[Sin[y], $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -5.5 \cdot 10^{+161} \lor \neg \left(z \leq 9.5 \cdot 10^{+176}\right):\\
                  \;\;\;\;\left(-z\right) \cdot \sin y\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;1 + x\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -5.5000000000000005e161 or 9.4999999999999995e176 < z

                    1. Initial program 99.8%

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

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

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

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

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

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

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

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

                    if -5.5000000000000005e161 < z < 9.4999999999999995e176

                    1. Initial program 100.0%

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

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

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

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

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

                  Alternative 8: 70.5% accurate, 4.9× speedup?

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

                    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -1.5e6 < y < 3.8e13

                      1. Initial program 100.0%

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

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

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

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

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

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

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

                      if 3.8e13 < y

                      1. Initial program 99.9%

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

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

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

                        \[\leadsto \color{blue}{1 + x} \]
                    10. Recombined 3 regimes into one program.
                    11. Final simplification68.5%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1500000:\\ \;\;\;\;\left(-x\right) \cdot \left(\frac{-1}{x} - 1\right)\\ \mathbf{elif}\;y \leq 38000000000000:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(0.16666666666666666 \cdot z\right) \cdot y - 0.5, y, -z\right), y, 1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \]
                    12. Add Preprocessing

                    Alternative 9: 70.2% accurate, 7.1× speedup?

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

                      1. Initial program 99.8%

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

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

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

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

                      if -42000 < y < 1.34999999999999996e51

                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 10: 70.2% accurate, 7.1× speedup?

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

                      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(-x\right) \cdot \left(\frac{-1}{x} - 1\right) \]
                      9. Step-by-step derivation
                        1. Applied rewrites38.6%

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

                        if -42000 < y < 1.34999999999999996e51

                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

                        if 1.34999999999999996e51 < y

                        1. Initial program 99.8%

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

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

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

                          \[\leadsto \color{blue}{1 + x} \]
                      10. Recombined 3 regimes into one program.
                      11. Final simplification68.4%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -42000:\\ \;\;\;\;\left(-x\right) \cdot \left(\frac{-1}{x} - 1\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+51}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, 1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \]
                      12. Add Preprocessing

                      Alternative 11: 70.3% accurate, 8.8× speedup?

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

                        1. Initial program 99.8%

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

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

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

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

                        if -2.95000000000000015e26 < y < 4.1e52

                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 12: 62.4% accurate, 15.1× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+164}:\\ \;\;\;\;\left(-y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
                      (FPCore (x y z)
                       :precision binary64
                       (if (<= z -8.2e+164) (* (- y) z) (+ 1.0 x)))
                      double code(double x, double y, double z) {
                      	double tmp;
                      	if (z <= -8.2e+164) {
                      		tmp = -y * z;
                      	} else {
                      		tmp = 1.0 + x;
                      	}
                      	return tmp;
                      }
                      
                      real(8) function code(x, y, z)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          real(8) :: tmp
                          if (z <= (-8.2d+164)) then
                              tmp = -y * z
                          else
                              tmp = 1.0d0 + x
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z) {
                      	double tmp;
                      	if (z <= -8.2e+164) {
                      		tmp = -y * z;
                      	} else {
                      		tmp = 1.0 + x;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z):
                      	tmp = 0
                      	if z <= -8.2e+164:
                      		tmp = -y * z
                      	else:
                      		tmp = 1.0 + x
                      	return tmp
                      
                      function code(x, y, z)
                      	tmp = 0.0
                      	if (z <= -8.2e+164)
                      		tmp = Float64(Float64(-y) * z);
                      	else
                      		tmp = Float64(1.0 + x);
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z)
                      	tmp = 0.0;
                      	if (z <= -8.2e+164)
                      		tmp = -y * z;
                      	else
                      		tmp = 1.0 + x;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_] := If[LessEqual[z, -8.2e+164], N[((-y) * z), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;z \leq -8.2 \cdot 10^{+164}:\\
                      \;\;\;\;\left(-y\right) \cdot z\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;1 + x\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if z < -8.20000000000000032e164

                        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

                          if -8.20000000000000032e164 < z

                          1. Initial program 99.9%

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

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

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

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

                        Alternative 13: 61.9% accurate, 53.0× speedup?

                        \[\begin{array}{l} \\ 1 + x \end{array} \]
                        (FPCore (x y z) :precision binary64 (+ 1.0 x))
                        double code(double x, double y, double z) {
                        	return 1.0 + x;
                        }
                        
                        real(8) function code(x, y, z)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            code = 1.0d0 + x
                        end function
                        
                        public static double code(double x, double y, double z) {
                        	return 1.0 + x;
                        }
                        
                        def code(x, y, z):
                        	return 1.0 + x
                        
                        function code(x, y, z)
                        	return Float64(1.0 + x)
                        end
                        
                        function tmp = code(x, y, z)
                        	tmp = 1.0 + x;
                        end
                        
                        code[x_, y_, z_] := N[(1.0 + x), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        1 + x
                        \end{array}
                        
                        Derivation
                        1. Initial program 99.9%

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

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

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

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

                        Alternative 14: 21.8% accurate, 212.0× speedup?

                        \[\begin{array}{l} \\ 1 \end{array} \]
                        (FPCore (x y z) :precision binary64 1.0)
                        double code(double x, double y, double z) {
                        	return 1.0;
                        }
                        
                        real(8) function code(x, y, z)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            code = 1.0d0
                        end function
                        
                        public static double code(double x, double y, double z) {
                        	return 1.0;
                        }
                        
                        def code(x, y, z):
                        	return 1.0
                        
                        function code(x, y, z)
                        	return 1.0
                        end
                        
                        function tmp = code(x, y, z)
                        	tmp = 1.0;
                        end
                        
                        code[x_, y_, z_] := 1.0
                        
                        \begin{array}{l}
                        
                        \\
                        1
                        \end{array}
                        
                        Derivation
                        1. Initial program 99.9%

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

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

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

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

                          \[\leadsto 1 \]
                        7. Step-by-step derivation
                          1. Applied rewrites18.0%

                            \[\leadsto 1 \]
                          2. Add Preprocessing

                          Reproduce

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