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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 84.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(\frac{1}{z} - \sin y\right)\\ \mathbf{if}\;z \leq -2.9 \cdot 10^{+225}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+185}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+140} \lor \neg \left(z \leq 6.8 \cdot 10^{+87}\right):\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (- (/ 1.0 z) (sin y)))))
   (if (<= z -2.9e+225)
     t_0
     (if (<= z -2.4e+185)
       (+ x (- 1.0 (* y z)))
       (if (or (<= z -3.6e+140) (not (<= z 6.8e+87))) t_0 (+ x (cos y)))))))
double code(double x, double y, double z) {
	double t_0 = z * ((1.0 / z) - sin(y));
	double tmp;
	if (z <= -2.9e+225) {
		tmp = t_0;
	} else if (z <= -2.4e+185) {
		tmp = x + (1.0 - (y * z));
	} else if ((z <= -3.6e+140) || !(z <= 6.8e+87)) {
		tmp = t_0;
	} else {
		tmp = x + cos(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) :: tmp
    t_0 = z * ((1.0d0 / z) - sin(y))
    if (z <= (-2.9d+225)) then
        tmp = t_0
    else if (z <= (-2.4d+185)) then
        tmp = x + (1.0d0 - (y * z))
    else if ((z <= (-3.6d+140)) .or. (.not. (z <= 6.8d+87))) then
        tmp = t_0
    else
        tmp = x + cos(y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * ((1.0 / z) - Math.sin(y));
	double tmp;
	if (z <= -2.9e+225) {
		tmp = t_0;
	} else if (z <= -2.4e+185) {
		tmp = x + (1.0 - (y * z));
	} else if ((z <= -3.6e+140) || !(z <= 6.8e+87)) {
		tmp = t_0;
	} else {
		tmp = x + Math.cos(y);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * ((1.0 / z) - math.sin(y))
	tmp = 0
	if z <= -2.9e+225:
		tmp = t_0
	elif z <= -2.4e+185:
		tmp = x + (1.0 - (y * z))
	elif (z <= -3.6e+140) or not (z <= 6.8e+87):
		tmp = t_0
	else:
		tmp = x + math.cos(y)
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(Float64(1.0 / z) - sin(y)))
	tmp = 0.0
	if (z <= -2.9e+225)
		tmp = t_0;
	elseif (z <= -2.4e+185)
		tmp = Float64(x + Float64(1.0 - Float64(y * z)));
	elseif ((z <= -3.6e+140) || !(z <= 6.8e+87))
		tmp = t_0;
	else
		tmp = Float64(x + cos(y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * ((1.0 / z) - sin(y));
	tmp = 0.0;
	if (z <= -2.9e+225)
		tmp = t_0;
	elseif (z <= -2.4e+185)
		tmp = x + (1.0 - (y * z));
	elseif ((z <= -3.6e+140) || ~((z <= 6.8e+87)))
		tmp = t_0;
	else
		tmp = x + cos(y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(1.0 / z), $MachinePrecision] - N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+225], t$95$0, If[LessEqual[z, -2.4e+185], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -3.6e+140], N[Not[LessEqual[z, 6.8e+87]], $MachinePrecision]], t$95$0, N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(\frac{1}{z} - \sin y\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+225}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -2.4 \cdot 10^{+185}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\

\mathbf{elif}\;z \leq -3.6 \cdot 10^{+140} \lor \neg \left(z \leq 6.8 \cdot 10^{+87}\right):\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;x + \cos y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.9000000000000001e225 or -2.39999999999999989e185 < z < -3.6e140 or 6.8000000000000004e87 < z

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{-z \cdot \left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)} \]
      2. distribute-rgt-neg-in99.6%

        \[\leadsto \color{blue}{z \cdot \left(-\left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)\right)} \]
      3. distribute-lft-out--99.6%

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

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

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

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

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

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

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

    if -2.9000000000000001e225 < z < -2.39999999999999989e185

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{\left(x + 1\right)} + -1 \cdot \left(y \cdot z\right) \]
      3. associate-+l+89.5%

        \[\leadsto \color{blue}{x + \left(1 + -1 \cdot \left(y \cdot z\right)\right)} \]
      4. mul-1-neg89.5%

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

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

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

    if -3.6e140 < z < 6.8000000000000004e87

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + \cos y} \]
    4. Step-by-step derivation
      1. +-commutative92.6%

        \[\leadsto \color{blue}{\cos y + x} \]
    5. Simplified92.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+225}:\\ \;\;\;\;z \cdot \left(\frac{1}{z} - \sin y\right)\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+185}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+140} \lor \neg \left(z \leq 6.8 \cdot 10^{+87}\right):\\ \;\;\;\;z \cdot \left(\frac{1}{z} - \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 81.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(-\sin y\right)\\ \mathbf{if}\;z \leq -7 \cdot 10^{+226}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+186}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+143} \lor \neg \left(z \leq 1.42 \cdot 10^{+88}\right):\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (- (sin y)))))
   (if (<= z -7e+226)
     t_0
     (if (<= z -3.5e+186)
       (+ x (- 1.0 (* y z)))
       (if (or (<= z -2e+143) (not (<= z 1.42e+88))) t_0 (+ x (cos y)))))))
double code(double x, double y, double z) {
	double t_0 = z * -sin(y);
	double tmp;
	if (z <= -7e+226) {
		tmp = t_0;
	} else if (z <= -3.5e+186) {
		tmp = x + (1.0 - (y * z));
	} else if ((z <= -2e+143) || !(z <= 1.42e+88)) {
		tmp = t_0;
	} else {
		tmp = x + cos(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) :: tmp
    t_0 = z * -sin(y)
    if (z <= (-7d+226)) then
        tmp = t_0
    else if (z <= (-3.5d+186)) then
        tmp = x + (1.0d0 - (y * z))
    else if ((z <= (-2d+143)) .or. (.not. (z <= 1.42d+88))) then
        tmp = t_0
    else
        tmp = x + cos(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 tmp;
	if (z <= -7e+226) {
		tmp = t_0;
	} else if (z <= -3.5e+186) {
		tmp = x + (1.0 - (y * z));
	} else if ((z <= -2e+143) || !(z <= 1.42e+88)) {
		tmp = t_0;
	} else {
		tmp = x + Math.cos(y);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * -math.sin(y)
	tmp = 0
	if z <= -7e+226:
		tmp = t_0
	elif z <= -3.5e+186:
		tmp = x + (1.0 - (y * z))
	elif (z <= -2e+143) or not (z <= 1.42e+88):
		tmp = t_0
	else:
		tmp = x + math.cos(y)
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(-sin(y)))
	tmp = 0.0
	if (z <= -7e+226)
		tmp = t_0;
	elseif (z <= -3.5e+186)
		tmp = Float64(x + Float64(1.0 - Float64(y * z)));
	elseif ((z <= -2e+143) || !(z <= 1.42e+88))
		tmp = t_0;
	else
		tmp = Float64(x + cos(y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * -sin(y);
	tmp = 0.0;
	if (z <= -7e+226)
		tmp = t_0;
	elseif (z <= -3.5e+186)
		tmp = x + (1.0 - (y * z));
	elseif ((z <= -2e+143) || ~((z <= 1.42e+88)))
		tmp = t_0;
	else
		tmp = x + cos(y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-N[Sin[y], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[z, -7e+226], t$95$0, If[LessEqual[z, -3.5e+186], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2e+143], N[Not[LessEqual[z, 1.42e+88]], $MachinePrecision]], t$95$0, N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(-\sin y\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{+226}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -3.5 \cdot 10^{+186}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\

\mathbf{elif}\;z \leq -2 \cdot 10^{+143} \lor \neg \left(z \leq 1.42 \cdot 10^{+88}\right):\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;x + \cos y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.9999999999999996e226 or -3.49999999999999987e186 < z < -2e143 or 1.41999999999999996e88 < z

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \sin y\right)} \]
    4. Step-by-step derivation
      1. associate-*r*68.8%

        \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \sin y} \]
      2. neg-mul-168.8%

        \[\leadsto \color{blue}{\left(-z\right)} \cdot \sin y \]
      3. *-commutative68.8%

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

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

    if -6.9999999999999996e226 < z < -3.49999999999999987e186

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{\left(x + 1\right)} + -1 \cdot \left(y \cdot z\right) \]
      3. associate-+l+89.5%

        \[\leadsto \color{blue}{x + \left(1 + -1 \cdot \left(y \cdot z\right)\right)} \]
      4. mul-1-neg89.5%

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

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

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

    if -2e143 < z < 1.41999999999999996e88

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + \cos y} \]
    4. Step-by-step derivation
      1. +-commutative92.6%

        \[\leadsto \color{blue}{\cos y + x} \]
    5. Simplified92.6%

      \[\leadsto \color{blue}{\cos y + x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification85.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+226}:\\ \;\;\;\;z \cdot \left(-\sin y\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+186}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+143} \lor \neg \left(z \leq 1.42 \cdot 10^{+88}\right):\\ \;\;\;\;z \cdot \left(-\sin y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.1% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \lor \neg \left(z \leq 3.5 \cdot 10^{-16}\right):\\
\;\;\;\;z \cdot \left(\frac{x + 1}{z} - \sin y\right)\\

\mathbf{else}:\\
\;\;\;\;x + \cos y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.10000000000000009 or 3.50000000000000017e-16 < z

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{-z \cdot \left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)} \]
      2. distribute-rgt-neg-in99.7%

        \[\leadsto \color{blue}{z \cdot \left(-\left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)\right)} \]
      3. distribute-lft-out--99.7%

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

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

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

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

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

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

    if -3.10000000000000009 < z < 3.50000000000000017e-16

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + \cos y} \]
    4. Step-by-step derivation
      1. +-commutative99.2%

        \[\leadsto \color{blue}{\cos y + x} \]
    5. Simplified99.2%

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

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

Alternative 5: 92.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+77} \lor \neg \left(z \leq 1.75 \cdot 10^{+69}\right):\\ \;\;\;\;z \cdot \left(\frac{x}{z} - \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -2.5e+77) (not (<= z 1.75e+69)))
   (* z (- (/ x z) (sin y)))
   (+ x (cos y))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -2.5e+77) || !(z <= 1.75e+69)) {
		tmp = z * ((x / z) - sin(y));
	} else {
		tmp = x + cos(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 ((z <= (-2.5d+77)) .or. (.not. (z <= 1.75d+69))) then
        tmp = z * ((x / z) - sin(y))
    else
        tmp = x + cos(y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -2.5e+77) || !(z <= 1.75e+69)) {
		tmp = z * ((x / z) - Math.sin(y));
	} else {
		tmp = x + Math.cos(y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -2.5e+77) or not (z <= 1.75e+69):
		tmp = z * ((x / z) - math.sin(y))
	else:
		tmp = x + math.cos(y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -2.5e+77) || !(z <= 1.75e+69))
		tmp = Float64(z * Float64(Float64(x / z) - sin(y)));
	else
		tmp = Float64(x + cos(y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -2.5e+77) || ~((z <= 1.75e+69)))
		tmp = z * ((x / z) - sin(y));
	else
		tmp = x + cos(y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.5e+77], N[Not[LessEqual[z, 1.75e+69]], $MachinePrecision]], N[(z * N[(N[(x / z), $MachinePrecision] - N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+77} \lor \neg \left(z \leq 1.75 \cdot 10^{+69}\right):\\
\;\;\;\;z \cdot \left(\frac{x}{z} - \sin y\right)\\

\mathbf{else}:\\
\;\;\;\;x + \cos y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.50000000000000002e77 or 1.74999999999999994e69 < z

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{-z \cdot \left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)} \]
      2. distribute-rgt-neg-in99.6%

        \[\leadsto \color{blue}{z \cdot \left(-\left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)\right)} \]
      3. distribute-lft-out--99.6%

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

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

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

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

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

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

    if -2.50000000000000002e77 < z < 1.74999999999999994e69

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + \cos y} \]
    4. Step-by-step derivation
      1. +-commutative95.4%

        \[\leadsto \color{blue}{\cos y + x} \]
    5. Simplified95.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+77} \lor \neg \left(z \leq 1.75 \cdot 10^{+69}\right):\\ \;\;\;\;z \cdot \left(\frac{x}{z} - \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 80.6% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.32 \lor \neg \left(y \leq 0.0072\right):\\
\;\;\;\;x + \cos y\\

\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(\left(y \cdot z\right) \cdot 0.16666666666666666 - 0.5\right) - z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.320000000000000007 or 0.0071999999999999998 < y

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x + \cos y} \]
    4. Step-by-step derivation
      1. +-commutative58.2%

        \[\leadsto \color{blue}{\cos y + x} \]
    5. Simplified58.2%

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

    if -0.320000000000000007 < y < 0.0071999999999999998

    1. Initial program 100.0%

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

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

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

Alternative 7: 71.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{-13} \lor \neg \left(x \leq 1.6 \cdot 10^{-42}\right):\\
\;\;\;\;x + 1\\

\mathbf{else}:\\
\;\;\;\;\cos y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.2000000000000001e-13 or 1.60000000000000012e-42 < 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 75.8%

      \[\leadsto \color{blue}{1 + x} \]
    4. Step-by-step derivation
      1. +-commutative75.8%

        \[\leadsto \color{blue}{x + 1} \]
    5. Simplified75.8%

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

    if -5.2000000000000001e-13 < x < 1.60000000000000012e-42

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{-z \cdot \left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)} \]
      2. distribute-rgt-neg-in99.7%

        \[\leadsto \color{blue}{z \cdot \left(-\left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)\right)} \]
      3. distribute-lft-out--99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\cos y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification69.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{-13} \lor \neg \left(x \leq 1.6 \cdot 10^{-42}\right):\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;\cos y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 68.8% accurate, 7.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+22} \lor \neg \left(y \leq 1.3 \cdot 10^{+68}\right):\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(\left(y \cdot z\right) \cdot 0.16666666666666666 - 0.5\right) - z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -1.8e+22) (not (<= y 1.3e+68)))
   (+ x 1.0)
   (+ 1.0 (+ x (* y (- (* y (- (* (* y z) 0.16666666666666666) 0.5)) z))))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.8e+22) || !(y <= 1.3e+68)) {
		tmp = x + 1.0;
	} else {
		tmp = 1.0 + (x + (y * ((y * (((y * z) * 0.16666666666666666) - 0.5)) - 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 <= (-1.8d+22)) .or. (.not. (y <= 1.3d+68))) then
        tmp = x + 1.0d0
    else
        tmp = 1.0d0 + (x + (y * ((y * (((y * z) * 0.16666666666666666d0) - 0.5d0)) - z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.8e+22) || !(y <= 1.3e+68)) {
		tmp = x + 1.0;
	} else {
		tmp = 1.0 + (x + (y * ((y * (((y * z) * 0.16666666666666666) - 0.5)) - z)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -1.8e+22) or not (y <= 1.3e+68):
		tmp = x + 1.0
	else:
		tmp = 1.0 + (x + (y * ((y * (((y * z) * 0.16666666666666666) - 0.5)) - z)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -1.8e+22) || !(y <= 1.3e+68))
		tmp = Float64(x + 1.0);
	else
		tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(Float64(y * z) * 0.16666666666666666) - 0.5)) - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -1.8e+22) || ~((y <= 1.3e+68)))
		tmp = x + 1.0;
	else
		tmp = 1.0 + (x + (y * ((y * (((y * z) * 0.16666666666666666) - 0.5)) - z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.8e+22], N[Not[LessEqual[y, 1.3e+68]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * N[(N[(N[(y * z), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+22} \lor \neg \left(y \leq 1.3 \cdot 10^{+68}\right):\\
\;\;\;\;x + 1\\

\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(\left(y \cdot z\right) \cdot 0.16666666666666666 - 0.5\right) - z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.8e22 or 1.2999999999999999e68 < 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 39.3%

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

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

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

    if -1.8e22 < y < 1.2999999999999999e68

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+22} \lor \neg \left(y \leq 1.3 \cdot 10^{+68}\right):\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(\left(y \cdot z\right) \cdot 0.16666666666666666 - 0.5\right) - z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 68.9% accurate, 9.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+24} \lor \neg \left(y \leq 1.3 \cdot 10^{+68}\right):\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x + y \cdot \left(y \cdot -0.5 - z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -4e+24) (not (<= y 1.3e+68)))
   (+ x 1.0)
   (+ 1.0 (+ x (* y (- (* y -0.5) z))))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -4e+24) || !(y <= 1.3e+68)) {
		tmp = x + 1.0;
	} else {
		tmp = 1.0 + (x + (y * ((y * -0.5) - 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 <= (-4d+24)) .or. (.not. (y <= 1.3d+68))) then
        tmp = x + 1.0d0
    else
        tmp = 1.0d0 + (x + (y * ((y * (-0.5d0)) - z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -4e+24) || !(y <= 1.3e+68)) {
		tmp = x + 1.0;
	} else {
		tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -4e+24) or not (y <= 1.3e+68):
		tmp = x + 1.0
	else:
		tmp = 1.0 + (x + (y * ((y * -0.5) - z)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -4e+24) || !(y <= 1.3e+68))
		tmp = Float64(x + 1.0);
	else
		tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * -0.5) - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -4e+24) || ~((y <= 1.3e+68)))
		tmp = x + 1.0;
	else
		tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -4e+24], N[Not[LessEqual[y, 1.3e+68]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+24} \lor \neg \left(y \leq 1.3 \cdot 10^{+68}\right):\\
\;\;\;\;x + 1\\

\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot -0.5 - z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.9999999999999999e24 or 1.2999999999999999e68 < 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 39.0%

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

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

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

    if -3.9999999999999999e24 < y < 1.2999999999999999e68

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+24} \lor \neg \left(y \leq 1.3 \cdot 10^{+68}\right):\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x + y \cdot \left(y \cdot -0.5 - z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 69.3% accurate, 12.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+26} \lor \neg \left(y \leq 0.0072\right):\\
\;\;\;\;x + 1\\

\mathbf{else}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.20000000000000007e26 or 0.0071999999999999998 < 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 37.9%

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

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

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

    if -2.20000000000000007e26 < y < 0.0071999999999999998

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(1 + x\right) + -1 \cdot \left(y \cdot z\right)} \]
      2. +-commutative97.3%

        \[\leadsto \color{blue}{\left(x + 1\right)} + -1 \cdot \left(y \cdot z\right) \]
      3. associate-+l+97.3%

        \[\leadsto \color{blue}{x + \left(1 + -1 \cdot \left(y \cdot z\right)\right)} \]
      4. mul-1-neg97.3%

        \[\leadsto x + \left(1 + \color{blue}{\left(-y \cdot z\right)}\right) \]
      5. unsub-neg97.3%

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

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

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

Alternative 11: 66.5% accurate, 13.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-20} \lor \neg \left(x \leq 7 \cdot 10^{-17}\right):\\
\;\;\;\;x + 1\\

\mathbf{else}:\\
\;\;\;\;1 - y \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.5000000000000005e-20 or 7.0000000000000003e-17 < 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 75.7%

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

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

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

    if -8.5000000000000005e-20 < x < 7.0000000000000003e-17

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{-z \cdot \left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)} \]
      2. distribute-rgt-neg-in99.7%

        \[\leadsto \color{blue}{z \cdot \left(-\left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)\right)} \]
      3. distribute-lft-out--99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 + -1 \cdot \left(y \cdot z\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg54.3%

        \[\leadsto 1 + \color{blue}{\left(-y \cdot z\right)} \]
      2. unsub-neg54.3%

        \[\leadsto \color{blue}{1 - y \cdot z} \]
      3. *-commutative54.3%

        \[\leadsto 1 - \color{blue}{z \cdot y} \]
    9. Simplified54.3%

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

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

Alternative 12: 59.8% accurate, 18.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -17200000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -17200000000000.0) x (if (<= x 1.0) 1.0 x)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -17200000000000.0) {
		tmp = x;
	} else if (x <= 1.0) {
		tmp = 1.0;
	} else {
		tmp = 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 (x <= (-17200000000000.0d0)) then
        tmp = x
    else if (x <= 1.0d0) then
        tmp = 1.0d0
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -17200000000000.0) {
		tmp = x;
	} else if (x <= 1.0) {
		tmp = 1.0;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -17200000000000.0:
		tmp = x
	elif x <= 1.0:
		tmp = 1.0
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -17200000000000.0)
		tmp = x;
	elseif (x <= 1.0)
		tmp = 1.0;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -17200000000000.0)
		tmp = x;
	elseif (x <= 1.0)
		tmp = 1.0;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -17200000000000.0], x, If[LessEqual[x, 1.0], 1.0, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -17200000000000:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1:\\
\;\;\;\;1\\

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


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

    1. Initial program 99.9%

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

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

    if -1.72e13 < x < 1

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{-z \cdot \left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)} \]
      2. distribute-rgt-neg-in99.6%

        \[\leadsto \color{blue}{z \cdot \left(-\left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)\right)} \]
      3. distribute-lft-out--99.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -17200000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 60.9% accurate, 69.0× speedup?

\[\begin{array}{l} \\ x + 1 \end{array} \]
(FPCore (x y z) :precision binary64 (+ x 1.0))
double code(double x, double y, double z) {
	return x + 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 = x + 1.0d0
end function
public static double code(double x, double y, double z) {
	return x + 1.0;
}
def code(x, y, z):
	return x + 1.0
function code(x, y, z)
	return Float64(x + 1.0)
end
function tmp = code(x, y, z)
	tmp = x + 1.0;
end
code[x_, y_, z_] := N[(x + 1.0), $MachinePrecision]
\begin{array}{l}

\\
x + 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 59.5%

    \[\leadsto \color{blue}{1 + x} \]
  4. Step-by-step derivation
    1. +-commutative59.5%

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

    \[\leadsto \color{blue}{x + 1} \]
  6. Final simplification59.5%

    \[\leadsto x + 1 \]
  7. Add Preprocessing

Alternative 14: 21.2% accurate, 207.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 z around -inf 88.3%

    \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)\right)} \]
  4. Step-by-step derivation
    1. mul-1-neg88.3%

      \[\leadsto \color{blue}{-z \cdot \left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)} \]
    2. distribute-rgt-neg-in88.3%

      \[\leadsto \color{blue}{z \cdot \left(-\left(-1 \cdot \frac{x + \cos y}{z} - -1 \cdot \sin y\right)\right)} \]
    3. distribute-lft-out--88.3%

      \[\leadsto z \cdot \left(-\color{blue}{-1 \cdot \left(\frac{x + \cos y}{z} - \sin y\right)}\right) \]
    4. mul-1-neg88.3%

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  8. Final simplification21.5%

    \[\leadsto 1 \]
  9. Add Preprocessing

Reproduce

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