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

Percentage Accurate: 99.9% → 99.9%
Time: 7.4s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

Alternative 2: 81.1% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -0.1:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-25}:\\
\;\;\;\;\left(z + y\right) + x\\

\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;z + x\\


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

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{z + x} \]
      2. lower-+.f6477.8

        \[\leadsto \color{blue}{z + x} \]
    5. Applied rewrites77.8%

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

    if -5e7 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -0.10000000000000001 or 2.00000000000000008e-25 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 1

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1, z, \color{blue}{\sin y}\right) \]
      5. Step-by-step derivation
        1. lower-sin.f6497.8

          \[\leadsto \mathsf{fma}\left(1, z, \color{blue}{\sin y}\right) \]
      6. Applied rewrites97.8%

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

      if -0.10000000000000001 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 2.00000000000000008e-25

      1. Initial program 99.9%

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

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

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

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

          \[\leadsto \color{blue}{\left(z + y\right)} + x \]
        4. lower-+.f64100.0

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

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

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

    Alternative 3: 89.5% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+80} \lor \neg \left(z \leq 9 \cdot 10^{+121}\right):\\ \;\;\;\;z \cdot \cos y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1, z, \sin y + x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (or (<= z -2.3e+80) (not (<= z 9e+121)))
       (* z (cos y))
       (fma 1.0 z (+ (sin y) x))))
    double code(double x, double y, double z) {
    	double tmp;
    	if ((z <= -2.3e+80) || !(z <= 9e+121)) {
    		tmp = z * cos(y);
    	} else {
    		tmp = fma(1.0, z, (sin(y) + x));
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	tmp = 0.0
    	if ((z <= -2.3e+80) || !(z <= 9e+121))
    		tmp = Float64(z * cos(y));
    	else
    		tmp = fma(1.0, z, Float64(sin(y) + x));
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := If[Or[LessEqual[z, -2.3e+80], N[Not[LessEqual[z, 9e+121]], $MachinePrecision]], N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(1.0 * z + N[(N[Sin[y], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -2.3 \cdot 10^{+80} \lor \neg \left(z \leq 9 \cdot 10^{+121}\right):\\
    \;\;\;\;z \cdot \cos y\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(1, z, \sin y + x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -2.30000000000000004e80 or 9.0000000000000007e121 < z

      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(1, z, \color{blue}{\sin y + x}\right) \]
        3. Applied rewrites59.6%

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

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

            \[\leadsto \color{blue}{z \cdot \cos y} \]
          2. lower-cos.f6483.8

            \[\leadsto z \cdot \color{blue}{\cos y} \]
        6. Applied rewrites83.8%

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

        if -2.30000000000000004e80 < z < 9.0000000000000007e121

        1. Initial program 100.0%

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

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

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

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

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

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

              \[\leadsto \color{blue}{1 \cdot z} + \left(x + \sin y\right) \]
            5. lower-fma.f6496.8

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

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

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

              \[\leadsto \mathsf{fma}\left(1, z, \color{blue}{\sin y + x}\right) \]
          3. Applied rewrites96.8%

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

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

        Alternative 4: 67.6% accurate, 1.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+164} \lor \neg \left(y \leq 1.4 \cdot 10^{+120}\right):\\ \;\;\;\;z \cdot \cos y\\ \mathbf{else}:\\ \;\;\;\;\left(z + y\right) + x\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (or (<= y -2.9e+164) (not (<= y 1.4e+120))) (* z (cos y)) (+ (+ z y) x)))
        double code(double x, double y, double z) {
        	double tmp;
        	if ((y <= -2.9e+164) || !(y <= 1.4e+120)) {
        		tmp = z * cos(y);
        	} else {
        		tmp = (z + y) + 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 ((y <= (-2.9d+164)) .or. (.not. (y <= 1.4d+120))) then
                tmp = z * cos(y)
            else
                tmp = (z + y) + x
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z) {
        	double tmp;
        	if ((y <= -2.9e+164) || !(y <= 1.4e+120)) {
        		tmp = z * Math.cos(y);
        	} else {
        		tmp = (z + y) + x;
        	}
        	return tmp;
        }
        
        def code(x, y, z):
        	tmp = 0
        	if (y <= -2.9e+164) or not (y <= 1.4e+120):
        		tmp = z * math.cos(y)
        	else:
        		tmp = (z + y) + x
        	return tmp
        
        function code(x, y, z)
        	tmp = 0.0
        	if ((y <= -2.9e+164) || !(y <= 1.4e+120))
        		tmp = Float64(z * cos(y));
        	else
        		tmp = Float64(Float64(z + y) + x);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z)
        	tmp = 0.0;
        	if ((y <= -2.9e+164) || ~((y <= 1.4e+120)))
        		tmp = z * cos(y);
        	else
        		tmp = (z + y) + x;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_] := If[Or[LessEqual[y, -2.9e+164], N[Not[LessEqual[y, 1.4e+120]], $MachinePrecision]], N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(N[(z + y), $MachinePrecision] + x), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -2.9 \cdot 10^{+164} \lor \neg \left(y \leq 1.4 \cdot 10^{+120}\right):\\
        \;\;\;\;z \cdot \cos y\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(z + y\right) + x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -2.8999999999999999e164 or 1.4e120 < y

          1. Initial program 99.8%

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

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

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

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

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

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

                \[\leadsto \color{blue}{1 \cdot z} + \left(x + \sin y\right) \]
              5. lower-fma.f6455.0

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

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

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

                \[\leadsto \mathsf{fma}\left(1, z, \color{blue}{\sin y + x}\right) \]
            3. Applied rewrites55.0%

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

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

                \[\leadsto \color{blue}{z \cdot \cos y} \]
              2. lower-cos.f6451.0

                \[\leadsto z \cdot \color{blue}{\cos y} \]
            6. Applied rewrites51.0%

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

            if -2.8999999999999999e164 < y < 1.4e120

            1. Initial program 100.0%

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

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

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

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

                \[\leadsto \color{blue}{\left(z + y\right)} + x \]
              4. lower-+.f6484.3

                \[\leadsto \color{blue}{\left(z + y\right)} + x \]
            5. Applied rewrites84.3%

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

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

          Alternative 5: 70.2% accurate, 6.4× speedup?

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

            1. Initial program 99.9%

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

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

                \[\leadsto \color{blue}{z + x} \]
              2. lower-+.f6436.0

                \[\leadsto \color{blue}{z + x} \]
            5. Applied rewrites36.0%

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

            if -1.12e21 < y < 70

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 70 < y

            1. Initial program 99.8%

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

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

                \[\leadsto \color{blue}{z + x} \]
              2. lower-+.f6444.4

                \[\leadsto \color{blue}{z + x} \]
            5. Applied rewrites44.4%

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

              \[\leadsto x \cdot \color{blue}{\left(1 + \frac{z}{x}\right)} \]
            7. Step-by-step derivation
              1. Applied rewrites44.1%

                \[\leadsto \mathsf{fma}\left(\frac{z}{x}, \color{blue}{x}, x\right) \]
              2. Step-by-step derivation
                1. Applied rewrites46.4%

                  \[\leadsto x - z \cdot \color{blue}{1} \]
              3. Recombined 3 regimes into one program.
              4. Final simplification71.5%

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

              Alternative 6: 67.8% accurate, 13.2× speedup?

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

                1. Initial program 99.9%

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

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

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

                    \[\leadsto \color{blue}{z + x} \]
                5. Applied rewrites73.8%

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

                if -7.59999999999999997e-137 < x < 5.4999999999999994e-169

                1. Initial program 99.9%

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

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

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

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

                    \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                  4. lower-+.f6457.6

                    \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                5. Applied rewrites57.6%

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

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

                    \[\leadsto z + \color{blue}{y} \]
                8. Recombined 2 regimes into one program.
                9. Final simplification69.2%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.6 \cdot 10^{-137} \lor \neg \left(x \leq 5.5 \cdot 10^{-169}\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;z + y\\ \end{array} \]
                10. Add Preprocessing

                Alternative 7: 58.4% accurate, 13.2× speedup?

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

                  1. Initial program 99.9%

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

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

                      \[\leadsto \color{blue}{z + x} \]
                    2. lower-+.f6482.8

                      \[\leadsto \color{blue}{z + x} \]
                  5. Applied rewrites82.8%

                    \[\leadsto \color{blue}{z + x} \]
                  6. Step-by-step derivation
                    1. Applied rewrites41.8%

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

                      \[\leadsto -1 \cdot \color{blue}{\left(x \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
                    3. Step-by-step derivation
                      1. Applied rewrites72.7%

                        \[\leadsto x \]

                      if -8.5999999999999997e-13 < x < 1.22e-33

                      1. Initial program 99.9%

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

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

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

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

                          \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                        4. lower-+.f6454.8

                          \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                      5. Applied rewrites54.8%

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

                        \[\leadsto y + \color{blue}{z} \]
                      7. Step-by-step derivation
                        1. Applied rewrites48.5%

                          \[\leadsto z + \color{blue}{y} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification61.6%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.6 \cdot 10^{-13} \lor \neg \left(x \leq 1.22 \cdot 10^{-33}\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z + y\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 8: 65.9% accurate, 16.3× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 106:\\ \;\;\;\;\left(z + y\right) + x\\ \mathbf{else}:\\ \;\;\;\;x - z\\ \end{array} \end{array} \]
                      (FPCore (x y z) :precision binary64 (if (<= y 106.0) (+ (+ z y) x) (- x z)))
                      double code(double x, double y, double z) {
                      	double tmp;
                      	if (y <= 106.0) {
                      		tmp = (z + y) + x;
                      	} else {
                      		tmp = x - 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) :: tmp
                          if (y <= 106.0d0) then
                              tmp = (z + y) + x
                          else
                              tmp = x - z
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z) {
                      	double tmp;
                      	if (y <= 106.0) {
                      		tmp = (z + y) + x;
                      	} else {
                      		tmp = x - z;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z):
                      	tmp = 0
                      	if y <= 106.0:
                      		tmp = (z + y) + x
                      	else:
                      		tmp = x - z
                      	return tmp
                      
                      function code(x, y, z)
                      	tmp = 0.0
                      	if (y <= 106.0)
                      		tmp = Float64(Float64(z + y) + x);
                      	else
                      		tmp = Float64(x - z);
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z)
                      	tmp = 0.0;
                      	if (y <= 106.0)
                      		tmp = (z + y) + x;
                      	else
                      		tmp = x - z;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_] := If[LessEqual[y, 106.0], N[(N[(z + y), $MachinePrecision] + x), $MachinePrecision], N[(x - z), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;y \leq 106:\\
                      \;\;\;\;\left(z + y\right) + x\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x - z\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if y < 106

                        1. Initial program 100.0%

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

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

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

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

                            \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                          4. lower-+.f6478.6

                            \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                        5. Applied rewrites78.6%

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

                        if 106 < y

                        1. Initial program 99.8%

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

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

                            \[\leadsto \color{blue}{z + x} \]
                          2. lower-+.f6444.4

                            \[\leadsto \color{blue}{z + x} \]
                        5. Applied rewrites44.4%

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

                          \[\leadsto x \cdot \color{blue}{\left(1 + \frac{z}{x}\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites44.1%

                            \[\leadsto \mathsf{fma}\left(\frac{z}{x}, \color{blue}{x}, x\right) \]
                          2. Step-by-step derivation
                            1. Applied rewrites46.4%

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 106:\\ \;\;\;\;\left(z + y\right) + x\\ \mathbf{else}:\\ \;\;\;\;x - z\\ \end{array} \]
                          5. Add Preprocessing

                          Alternative 9: 65.9% accurate, 16.3× speedup?

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

                            1. Initial program 100.0%

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

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

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

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

                                \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                              4. lower-+.f6476.9

                                \[\leadsto \color{blue}{\left(z + y\right)} + x \]
                            5. Applied rewrites76.9%

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

                            if 2.7000000000000001e36 < y

                            1. Initial program 99.8%

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

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

                                \[\leadsto \color{blue}{z + x} \]
                              2. lower-+.f6446.1

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.7 \cdot 10^{+36}:\\ \;\;\;\;\left(z + y\right) + x\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
                          5. Add Preprocessing

                          Alternative 10: 42.4% accurate, 212.0× speedup?

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

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

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

                              \[\leadsto \color{blue}{z + x} \]
                            2. lower-+.f6465.5

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

                            \[\leadsto \color{blue}{z + x} \]
                          6. Step-by-step derivation
                            1. Applied rewrites32.6%

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

                              \[\leadsto -1 \cdot \color{blue}{\left(x \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
                            3. Step-by-step derivation
                              1. Applied rewrites43.3%

                                \[\leadsto x \]
                              2. Final simplification43.3%

                                \[\leadsto x \]
                              3. Add Preprocessing

                              Reproduce

                              ?
                              herbie shell --seed 2024326 
                              (FPCore (x y z)
                                :name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
                                :precision binary64
                                (+ (+ x (sin y)) (* z (cos y))))