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

Percentage Accurate: 99.9% → 99.9%
Time: 7.4s
Alternatives: 11
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 11 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.4% accurate, 0.3× 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 -1000000000000 \lor \neg \left(t\_1 \leq 0.996\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))) (t_1 (- (+ x (cos y)) t_0)))
   (if (or (<= t_1 -1000000000000.0) (not (<= t_1 0.996)))
     (- (+ x 1.0) t_0)
     (- (cos y) t_0))))
double code(double x, double y, double z) {
	double t_0 = z * sin(y);
	double t_1 = (x + cos(y)) - t_0;
	double tmp;
	if ((t_1 <= -1000000000000.0) || !(t_1 <= 0.996)) {
		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) :: t_1
    real(8) :: tmp
    t_0 = z * sin(y)
    t_1 = (x + cos(y)) - t_0
    if ((t_1 <= (-1000000000000.0d0)) .or. (.not. (t_1 <= 0.996d0))) 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 t_1 = (x + Math.cos(y)) - t_0;
	double tmp;
	if ((t_1 <= -1000000000000.0) || !(t_1 <= 0.996)) {
		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)
	t_1 = (x + math.cos(y)) - t_0
	tmp = 0
	if (t_1 <= -1000000000000.0) or not (t_1 <= 0.996):
		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))
	t_1 = Float64(Float64(x + cos(y)) - t_0)
	tmp = 0.0
	if ((t_1 <= -1000000000000.0) || !(t_1 <= 0.996))
		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);
	t_1 = (x + cos(y)) - t_0;
	tmp = 0.0;
	if ((t_1 <= -1000000000000.0) || ~((t_1 <= 0.996)))
		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]}, Block[{t$95$1 = N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1000000000000.0], N[Not[LessEqual[t$95$1, 0.996]], $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\\
t_1 := \left(x + \cos y\right) - t\_0\\
\mathbf{if}\;t\_1 \leq -1000000000000 \lor \neg \left(t\_1 \leq 0.996\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 (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -1e12 or 0.996 < (-.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 rewrites99.5%

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

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

      1. Initial program 99.9%

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

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

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

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

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

    Alternative 3: 93.0% 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 -0.99 \lor \neg \left(t\_2 \leq 40000000\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 -0.99) (not (<= t_2 40000000.0)))
         (- (+ 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 <= -0.99) || !(t_2 <= 40000000.0)) {
    		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 <= (-0.99d0)) .or. (.not. (t_2 <= 40000000.0d0))) 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 <= -0.99) || !(t_2 <= 40000000.0)) {
    		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 <= -0.99) or not (t_2 <= 40000000.0):
    		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 <= -0.99) || !(t_2 <= 40000000.0))
    		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 <= -0.99) || ~((t_2 <= 40000000.0)))
    		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, -0.99], N[Not[LessEqual[t$95$2, 40000000.0]], $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 -0.99 \lor \neg \left(t\_2 \leq 40000000\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))) < -0.98999999999999999 or 4e7 < (-.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 rewrites99.0%

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

        if -0.98999999999999999 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 4e7

        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 + \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-*.f6482.4

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x + \cos y\right) - z \cdot \sin y \leq -0.99 \lor \neg \left(\left(x + \cos y\right) - z \cdot \sin y \leq 40000000\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: 92.7% 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 -0.99 \lor \neg \left(t\_1 \leq 0.99\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 -0.99) (not (<= t_1 0.99)))
           (- (+ 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 <= -0.99) || !(t_1 <= 0.99)) {
      		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 <= (-0.99d0)) .or. (.not. (t_1 <= 0.99d0))) 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 <= -0.99) || !(t_1 <= 0.99)) {
      		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 <= -0.99) or not (t_1 <= 0.99):
      		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 <= -0.99) || !(t_1 <= 0.99))
      		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 <= -0.99) || ~((t_1 <= 0.99)))
      		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, -0.99], N[Not[LessEqual[t$95$1, 0.99]], $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 -0.99 \lor \neg \left(t\_1 \leq 0.99\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))) < -0.98999999999999999 or 0.98999999999999999 < (-.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.8%

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

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

          1. Initial program 99.9%

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

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

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

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

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

              \[\leadsto \cos y - \color{blue}{z \cdot y} \]
            2. lower-*.f6453.7

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

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

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

        Alternative 5: 72.9% accurate, 1.8× speedup?

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

          1. Initial program 99.9%

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

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

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

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

          if -4.0999999999999999e-7 < x < 2.55e-8

          1. Initial program 99.9%

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

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

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

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

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

              \[\leadsto \cos y - \color{blue}{z \cdot y} \]
            2. lower-*.f6461.9

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

            \[\leadsto \cos y - \color{blue}{z \cdot y} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification71.4%

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

        Alternative 6: 69.3% accurate, 1.8× speedup?

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

          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.f6442.1

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

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

          if -4.09999999999999996e23 < y < 3.6e14

          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-*.f6498.7

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

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

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

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

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

              \[\leadsto \left(x + \color{blue}{\mathsf{fma}\left({y}^{2} \cdot \left(\frac{1}{24} + \frac{-1}{720} \cdot {y}^{2}\right) - \frac{1}{2}, {y}^{2}, 1\right)}\right) - z \cdot y \]
            4. sub-negN/A

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(x + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{720}, y \cdot y, \frac{1}{24}\right), \color{blue}{y \cdot y}, \frac{-1}{2}\right), {y}^{2}, 1\right)\right) - z \cdot y \]
            14. unpow2N/A

              \[\leadsto \left(x + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{720}, y \cdot y, \frac{1}{24}\right), y \cdot y, \frac{-1}{2}\right), \color{blue}{y \cdot y}, 1\right)\right) - z \cdot y \]
            15. lower-*.f6496.7

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+23} \lor \neg \left(y \leq 3.6 \cdot 10^{+14}\right):\\ \;\;\;\;\left(-z\right) \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;\left(x + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.001388888888888889, y \cdot y, 0.041666666666666664\right), y \cdot y, -0.5\right), y \cdot y, 1\right)\right) - z \cdot y\\ \end{array} \]
        5. Add Preprocessing

        Alternative 7: 70.3% accurate, 7.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -880000000000 \lor \neg \left(y \leq 5.2 \cdot 10^{+33}\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 -880000000000.0) (not (<= y 5.2e+33)))
           (+ 1.0 x)
           (fma (- (* -0.5 y) z) y (+ 1.0 x))))
        double code(double x, double y, double z) {
        	double tmp;
        	if ((y <= -880000000000.0) || !(y <= 5.2e+33)) {
        		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 <= -880000000000.0) || !(y <= 5.2e+33))
        		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, -880000000000.0], N[Not[LessEqual[y, 5.2e+33]], $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 -880000000000 \lor \neg \left(y \leq 5.2 \cdot 10^{+33}\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 < -8.8e11 or 5.1999999999999995e33 < 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 -8.8e11 < y < 5.1999999999999995e33

          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.1

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

            \[\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.1%

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

        Alternative 8: 70.3% accurate, 9.6× speedup?

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

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

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

          if -1.40000000000000004e56 < y < 1.6600000000000001e25

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

              \[\leadsto x - \left(z \cdot y + \color{blue}{-1}\right) \]
            9. lower-fma.f6489.9

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

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

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

        Alternative 9: 67.3% accurate, 10.1× speedup?

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

          1. Initial program 99.9%

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

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

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

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

          if -3.00000000000000027e-42 < x < 2.4999999999999999e-8

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 10: 61.6% 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-+.f6460.5

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

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

          Alternative 11: 22.1% 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-+.f6460.5

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

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

            \[\leadsto 1 \]
          7. Step-by-step derivation
            1. Applied rewrites21.6%

              \[\leadsto 1 \]
            2. Add Preprocessing

            Reproduce

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