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

Percentage Accurate: 99.9% → 99.9%
Time: 9.5s
Alternatives: 12
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 12 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. Final simplification99.9%

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

Alternative 2: 99.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{-16} \lor \neg \left(x \leq 2.65 \cdot 10^{-6}\right):\\
\;\;\;\;\left(x + 1\right) - t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.7e-16 or 2.65e-6 < x

    1. Initial program 99.9%

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

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

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

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

    if -3.7e-16 < x < 2.65e-6

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.7 \cdot 10^{-16} \lor \neg \left(x \leq 2.65 \cdot 10^{-6}\right):\\ \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;\cos y - z \cdot \sin y\\ \end{array} \]

Alternative 3: 83.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - z \cdot \sin y\\ \mathbf{if}\;z \leq -6 \cdot 10^{+57}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+29}:\\ \;\;\;\;x + \cos y\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+73}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3.95 \cdot 10^{+149}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+220} \lor \neg \left(z \leq 1.45 \cdot 10^{+249}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- 1.0 (* z (sin y)))))
   (if (<= z -6e+57)
     t_0
     (if (<= z 1.2e+29)
       (+ x (cos y))
       (if (<= z 2.4e+73)
         t_0
         (if (<= z 3.95e+149)
           (+ x 1.0)
           (if (or (<= z 2.4e+220) (not (<= z 1.45e+249)))
             t_0
             (+ x (- 1.0 (* y z))))))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (z * sin(y));
	double tmp;
	if (z <= -6e+57) {
		tmp = t_0;
	} else if (z <= 1.2e+29) {
		tmp = x + cos(y);
	} else if (z <= 2.4e+73) {
		tmp = t_0;
	} else if (z <= 3.95e+149) {
		tmp = x + 1.0;
	} else if ((z <= 2.4e+220) || !(z <= 1.45e+249)) {
		tmp = t_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) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 - (z * sin(y))
    if (z <= (-6d+57)) then
        tmp = t_0
    else if (z <= 1.2d+29) then
        tmp = x + cos(y)
    else if (z <= 2.4d+73) then
        tmp = t_0
    else if (z <= 3.95d+149) then
        tmp = x + 1.0d0
    else if ((z <= 2.4d+220) .or. (.not. (z <= 1.45d+249))) then
        tmp = t_0
    else
        tmp = x + (1.0d0 - (y * z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 1.0 - (z * Math.sin(y));
	double tmp;
	if (z <= -6e+57) {
		tmp = t_0;
	} else if (z <= 1.2e+29) {
		tmp = x + Math.cos(y);
	} else if (z <= 2.4e+73) {
		tmp = t_0;
	} else if (z <= 3.95e+149) {
		tmp = x + 1.0;
	} else if ((z <= 2.4e+220) || !(z <= 1.45e+249)) {
		tmp = t_0;
	} else {
		tmp = x + (1.0 - (y * z));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (z * math.sin(y))
	tmp = 0
	if z <= -6e+57:
		tmp = t_0
	elif z <= 1.2e+29:
		tmp = x + math.cos(y)
	elif z <= 2.4e+73:
		tmp = t_0
	elif z <= 3.95e+149:
		tmp = x + 1.0
	elif (z <= 2.4e+220) or not (z <= 1.45e+249):
		tmp = t_0
	else:
		tmp = x + (1.0 - (y * z))
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(z * sin(y)))
	tmp = 0.0
	if (z <= -6e+57)
		tmp = t_0;
	elseif (z <= 1.2e+29)
		tmp = Float64(x + cos(y));
	elseif (z <= 2.4e+73)
		tmp = t_0;
	elseif (z <= 3.95e+149)
		tmp = Float64(x + 1.0);
	elseif ((z <= 2.4e+220) || !(z <= 1.45e+249))
		tmp = t_0;
	else
		tmp = Float64(x + Float64(1.0 - Float64(y * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 1.0 - (z * sin(y));
	tmp = 0.0;
	if (z <= -6e+57)
		tmp = t_0;
	elseif (z <= 1.2e+29)
		tmp = x + cos(y);
	elseif (z <= 2.4e+73)
		tmp = t_0;
	elseif (z <= 3.95e+149)
		tmp = x + 1.0;
	elseif ((z <= 2.4e+220) || ~((z <= 1.45e+249)))
		tmp = t_0;
	else
		tmp = x + (1.0 - (y * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+57], t$95$0, If[LessEqual[z, 1.2e+29], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+73], t$95$0, If[LessEqual[z, 3.95e+149], N[(x + 1.0), $MachinePrecision], If[Or[LessEqual[z, 2.4e+220], N[Not[LessEqual[z, 1.45e+249]], $MachinePrecision]], t$95$0, N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 - z \cdot \sin y\\
\mathbf{if}\;z \leq -6 \cdot 10^{+57}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+29}:\\
\;\;\;\;x + \cos y\\

\mathbf{elif}\;z \leq 2.4 \cdot 10^{+73}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 3.95 \cdot 10^{+149}:\\
\;\;\;\;x + 1\\

\mathbf{elif}\;z \leq 2.4 \cdot 10^{+220} \lor \neg \left(z \leq 1.45 \cdot 10^{+249}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.9999999999999999e57 or 1.2e29 < z < 2.40000000000000002e73 or 3.94999999999999982e149 < z < 2.3999999999999998e220 or 1.45000000000000008e249 < z

    1. Initial program 99.7%

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

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

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

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

      \[\leadsto \color{blue}{1 - z \cdot \sin y} \]

    if -5.9999999999999999e57 < z < 1.2e29

    1. Initial program 100.0%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
      2. flip-+76.2%

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

        \[\leadsto \frac{x \cdot x - \color{blue}{{\left(\cos y - z \cdot \sin y\right)}^{1}} \cdot \left(\cos y - z \cdot \sin y\right)}{x - \left(\cos y - z \cdot \sin y\right)} \]
      4. pow176.2%

        \[\leadsto \frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{1} \cdot \color{blue}{{\left(\cos y - z \cdot \sin y\right)}^{1}}}{x - \left(\cos y - z \cdot \sin y\right)} \]
      5. pow-prod-up76.2%

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

        \[\leadsto \frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{\color{blue}{2}}}{x - \left(\cos y - z \cdot \sin y\right)} \]
    3. Applied egg-rr76.2%

      \[\leadsto \color{blue}{\frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}{x - \left(\cos y - z \cdot \sin y\right)}} \]
    4. Step-by-step derivation
      1. clear-num76.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{x - \left(\cos y - z \cdot \sin y\right)}{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}}} \]
      2. inv-pow76.0%

        \[\leadsto \color{blue}{{\left(\frac{x - \left(\cos y - z \cdot \sin y\right)}{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}\right)}^{-1}} \]
      3. clear-num76.0%

        \[\leadsto {\color{blue}{\left(\frac{1}{\frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}{x - \left(\cos y - z \cdot \sin y\right)}}\right)}}^{-1} \]
      4. unpow276.0%

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

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

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

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

    if 2.40000000000000002e73 < z < 3.94999999999999982e149

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if 2.3999999999999998e220 < z < 1.45000000000000008e249

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+57}:\\ \;\;\;\;1 - z \cdot \sin y\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+29}:\\ \;\;\;\;x + \cos y\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+73}:\\ \;\;\;\;1 - z \cdot \sin y\\ \mathbf{elif}\;z \leq 3.95 \cdot 10^{+149}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+220} \lor \neg \left(z \leq 1.45 \cdot 10^{+249}\right):\\ \;\;\;\;1 - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \end{array} \]

Alternative 4: 81.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin y \cdot \left(-z\right)\\ \mathbf{if}\;z \leq -2.5 \cdot 10^{+116}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+30}:\\ \;\;\;\;x + \cos y\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+69} \lor \neg \left(z \leq 3.8 \cdot 10^{+150}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (sin y) (- z))))
   (if (<= z -2.5e+116)
     t_0
     (if (<= z 2.8e+30)
       (+ x (cos y))
       (if (or (<= z 4.4e+69) (not (<= z 3.8e+150))) t_0 (+ x 1.0))))))
double code(double x, double y, double z) {
	double t_0 = sin(y) * -z;
	double tmp;
	if (z <= -2.5e+116) {
		tmp = t_0;
	} else if (z <= 2.8e+30) {
		tmp = x + cos(y);
	} else if ((z <= 4.4e+69) || !(z <= 3.8e+150)) {
		tmp = t_0;
	} else {
		tmp = x + 1.0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sin(y) * -z
    if (z <= (-2.5d+116)) then
        tmp = t_0
    else if (z <= 2.8d+30) then
        tmp = x + cos(y)
    else if ((z <= 4.4d+69) .or. (.not. (z <= 3.8d+150))) then
        tmp = t_0
    else
        tmp = x + 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.sin(y) * -z;
	double tmp;
	if (z <= -2.5e+116) {
		tmp = t_0;
	} else if (z <= 2.8e+30) {
		tmp = x + Math.cos(y);
	} else if ((z <= 4.4e+69) || !(z <= 3.8e+150)) {
		tmp = t_0;
	} else {
		tmp = x + 1.0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.sin(y) * -z
	tmp = 0
	if z <= -2.5e+116:
		tmp = t_0
	elif z <= 2.8e+30:
		tmp = x + math.cos(y)
	elif (z <= 4.4e+69) or not (z <= 3.8e+150):
		tmp = t_0
	else:
		tmp = x + 1.0
	return tmp
function code(x, y, z)
	t_0 = Float64(sin(y) * Float64(-z))
	tmp = 0.0
	if (z <= -2.5e+116)
		tmp = t_0;
	elseif (z <= 2.8e+30)
		tmp = Float64(x + cos(y));
	elseif ((z <= 4.4e+69) || !(z <= 3.8e+150))
		tmp = t_0;
	else
		tmp = Float64(x + 1.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = sin(y) * -z;
	tmp = 0.0;
	if (z <= -2.5e+116)
		tmp = t_0;
	elseif (z <= 2.8e+30)
		tmp = x + cos(y);
	elseif ((z <= 4.4e+69) || ~((z <= 3.8e+150)))
		tmp = t_0;
	else
		tmp = x + 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision]}, If[LessEqual[z, -2.5e+116], t$95$0, If[LessEqual[z, 2.8e+30], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 4.4e+69], N[Not[LessEqual[z, 3.8e+150]], $MachinePrecision]], t$95$0, N[(x + 1.0), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{+30}:\\
\;\;\;\;x + \cos y\\

\mathbf{elif}\;z \leq 4.4 \cdot 10^{+69} \lor \neg \left(z \leq 3.8 \cdot 10^{+150}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.50000000000000013e116 or 2.79999999999999983e30 < z < 4.4000000000000003e69 or 3.79999999999999989e150 < z

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\sin y \cdot \left(-z\right)} \]
    4. Simplified70.6%

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

    if -2.50000000000000013e116 < z < 2.79999999999999983e30

    1. Initial program 100.0%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
      2. flip-+77.2%

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

        \[\leadsto \frac{x \cdot x - \color{blue}{{\left(\cos y - z \cdot \sin y\right)}^{1}} \cdot \left(\cos y - z \cdot \sin y\right)}{x - \left(\cos y - z \cdot \sin y\right)} \]
      4. pow177.2%

        \[\leadsto \frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{1} \cdot \color{blue}{{\left(\cos y - z \cdot \sin y\right)}^{1}}}{x - \left(\cos y - z \cdot \sin y\right)} \]
      5. pow-prod-up77.2%

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

        \[\leadsto \frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{\color{blue}{2}}}{x - \left(\cos y - z \cdot \sin y\right)} \]
    3. Applied egg-rr77.2%

      \[\leadsto \color{blue}{\frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}{x - \left(\cos y - z \cdot \sin y\right)}} \]
    4. Step-by-step derivation
      1. clear-num76.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{x - \left(\cos y - z \cdot \sin y\right)}{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}}} \]
      2. inv-pow76.9%

        \[\leadsto \color{blue}{{\left(\frac{x - \left(\cos y - z \cdot \sin y\right)}{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}\right)}^{-1}} \]
      3. clear-num77.0%

        \[\leadsto {\color{blue}{\left(\frac{1}{\frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}{x - \left(\cos y - z \cdot \sin y\right)}}\right)}}^{-1} \]
      4. unpow277.0%

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

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

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

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

    if 4.4000000000000003e69 < z < 3.79999999999999989e150

    1. Initial program 99.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+116}:\\ \;\;\;\;\sin y \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+30}:\\ \;\;\;\;x + \cos y\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+69} \lor \neg \left(z \leq 3.8 \cdot 10^{+150}\right):\\ \;\;\;\;\sin y \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]

Alternative 5: 99.0% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -22.5 or 6.00000000000000023e-26 < z

    1. Initial program 99.8%

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

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

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

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

    if -22.5 < z < 6.00000000000000023e-26

    1. Initial program 100.0%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
      2. flip-+78.8%

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

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

        \[\leadsto \frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{1} \cdot \color{blue}{{\left(\cos y - z \cdot \sin y\right)}^{1}}}{x - \left(\cos y - z \cdot \sin y\right)} \]
      5. pow-prod-up78.8%

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

        \[\leadsto \frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{\color{blue}{2}}}{x - \left(\cos y - z \cdot \sin y\right)} \]
    3. Applied egg-rr78.8%

      \[\leadsto \color{blue}{\frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}{x - \left(\cos y - z \cdot \sin y\right)}} \]
    4. Step-by-step derivation
      1. clear-num78.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{x - \left(\cos y - z \cdot \sin y\right)}{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}}} \]
      2. inv-pow78.5%

        \[\leadsto \color{blue}{{\left(\frac{x - \left(\cos y - z \cdot \sin y\right)}{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}\right)}^{-1}} \]
      3. clear-num78.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -22.5 \lor \neg \left(z \leq 6 \cdot 10^{-26}\right):\\ \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \]

Alternative 6: 93.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1400000000 \lor \neg \left(z \leq 8 \cdot 10^{+29}\right):\\
\;\;\;\;x - z \cdot \sin y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.4e9 or 7.99999999999999931e29 < z

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x} - z \cdot \sin y \]

    if -1.4e9 < z < 7.99999999999999931e29

    1. Initial program 100.0%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
      2. flip-+78.8%

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

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

        \[\leadsto \frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{1} \cdot \color{blue}{{\left(\cos y - z \cdot \sin y\right)}^{1}}}{x - \left(\cos y - z \cdot \sin y\right)} \]
      5. pow-prod-up78.8%

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

        \[\leadsto \frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{\color{blue}{2}}}{x - \left(\cos y - z \cdot \sin y\right)} \]
    3. Applied egg-rr78.8%

      \[\leadsto \color{blue}{\frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}{x - \left(\cos y - z \cdot \sin y\right)}} \]
    4. Step-by-step derivation
      1. clear-num78.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{x - \left(\cos y - z \cdot \sin y\right)}{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}}} \]
      2. inv-pow78.5%

        \[\leadsto \color{blue}{{\left(\frac{x - \left(\cos y - z \cdot \sin y\right)}{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}\right)}^{-1}} \]
      3. clear-num78.6%

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

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

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

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

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

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

Alternative 7: 80.3% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+23} \lor \neg \left(y \leq 7.8 \cdot 10^{-16}\right):\\
\;\;\;\;x + \cos y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.49999999999999979e23 or 7.79999999999999954e-16 < y

    1. Initial program 99.8%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
      2. flip-+58.1%

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

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

        \[\leadsto \frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{1} \cdot \color{blue}{{\left(\cos y - z \cdot \sin y\right)}^{1}}}{x - \left(\cos y - z \cdot \sin y\right)} \]
      5. pow-prod-up58.1%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}{x - \left(\cos y - z \cdot \sin y\right)}} \]
    4. Step-by-step derivation
      1. clear-num57.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{x - \left(\cos y - z \cdot \sin y\right)}{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}}} \]
      2. inv-pow57.8%

        \[\leadsto \color{blue}{{\left(\frac{x - \left(\cos y - z \cdot \sin y\right)}{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}\right)}^{-1}} \]
      3. clear-num57.8%

        \[\leadsto {\color{blue}{\left(\frac{1}{\frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}{x - \left(\cos y - z \cdot \sin y\right)}}\right)}}^{-1} \]
      4. unpow257.8%

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

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

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

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

    if -4.49999999999999979e23 < y < 7.79999999999999954e-16

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+23} \lor \neg \left(y \leq 7.8 \cdot 10^{-16}\right):\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \end{array} \]

Alternative 8: 70.4% accurate, 18.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{+60}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 1.16 \cdot 10^{+77}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -2.15e+60)
   (+ x 1.0)
   (if (<= y 1.16e+77) (+ x (- 1.0 (* y z))) (+ x 1.0))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -2.15e+60) {
		tmp = x + 1.0;
	} else if (y <= 1.16e+77) {
		tmp = x + (1.0 - (y * z));
	} else {
		tmp = x + 1.0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-2.15d+60)) then
        tmp = x + 1.0d0
    else if (y <= 1.16d+77) then
        tmp = x + (1.0d0 - (y * z))
    else
        tmp = x + 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -2.15e+60) {
		tmp = x + 1.0;
	} else if (y <= 1.16e+77) {
		tmp = x + (1.0 - (y * z));
	} else {
		tmp = x + 1.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -2.15e+60:
		tmp = x + 1.0
	elif y <= 1.16e+77:
		tmp = x + (1.0 - (y * z))
	else:
		tmp = x + 1.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -2.15e+60)
		tmp = Float64(x + 1.0);
	elseif (y <= 1.16e+77)
		tmp = Float64(x + Float64(1.0 - Float64(y * z)));
	else
		tmp = Float64(x + 1.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -2.15e+60)
		tmp = x + 1.0;
	elseif (y <= 1.16e+77)
		tmp = x + (1.0 - (y * z));
	else
		tmp = x + 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -2.15e+60], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 1.16e+77], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+60}:\\
\;\;\;\;x + 1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.14999999999999986e60 or 1.1600000000000001e77 < y

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{x + 1} \]
    7. Simplified34.3%

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

    if -2.14999999999999986e60 < y < 1.1600000000000001e77

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{+60}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 1.16 \cdot 10^{+77}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]

Alternative 9: 66.1% accurate, 22.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+126} \lor \neg \left(z \leq 7.2 \cdot 10^{+191}\right):\\
\;\;\;\;x - y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.6999999999999998e126 or 7.1999999999999999e191 < z

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{x} - y \cdot z \]

    if -3.6999999999999998e126 < z < 7.1999999999999999e191

    1. Initial program 99.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+126} \lor \neg \left(z \leq 7.2 \cdot 10^{+191}\right):\\ \;\;\;\;x - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]

Alternative 10: 67.7% accurate, 22.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.7 \cdot 10^{-16}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-39}:\\ \;\;\;\;1 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -3.7e-16) (+ x 1.0) (if (<= x 1.1e-39) (- 1.0 (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -3.7e-16) {
		tmp = x + 1.0;
	} else if (x <= 1.1e-39) {
		tmp = 1.0 - (y * z);
	} else {
		tmp = x + 1.0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-3.7d-16)) then
        tmp = x + 1.0d0
    else if (x <= 1.1d-39) then
        tmp = 1.0d0 - (y * z)
    else
        tmp = x + 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -3.7e-16) {
		tmp = x + 1.0;
	} else if (x <= 1.1e-39) {
		tmp = 1.0 - (y * z);
	} else {
		tmp = x + 1.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -3.7e-16:
		tmp = x + 1.0
	elif x <= 1.1e-39:
		tmp = 1.0 - (y * z)
	else:
		tmp = x + 1.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -3.7e-16)
		tmp = Float64(x + 1.0);
	elseif (x <= 1.1e-39)
		tmp = Float64(1.0 - Float64(y * z));
	else
		tmp = Float64(x + 1.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -3.7e-16)
		tmp = x + 1.0;
	elseif (x <= 1.1e-39)
		tmp = 1.0 - (y * z);
	else
		tmp = x + 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -3.7e-16], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 1.1e-39], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-16}:\\
\;\;\;\;x + 1\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{-39}:\\
\;\;\;\;1 - y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.7e-16 or 1.1e-39 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -3.7e-16 < x < 1.1e-39

    1. Initial program 99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.7 \cdot 10^{-16}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-39}:\\ \;\;\;\;1 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]

Alternative 11: 62.4% 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. Taylor expanded in y around 0 85.4%

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

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

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

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

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

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

    \[\leadsto x + 1 \]

Alternative 12: 43.0% accurate, 207.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(x + \cos y\right) - z \cdot \sin y \]
  2. Step-by-step derivation
    1. associate--l+99.9%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    2. flip-+65.1%

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

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

      \[\leadsto \frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{1} \cdot \color{blue}{{\left(\cos y - z \cdot \sin y\right)}^{1}}}{x - \left(\cos y - z \cdot \sin y\right)} \]
    5. pow-prod-up65.1%

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

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

    \[\leadsto \color{blue}{\frac{x \cdot x - {\left(\cos y - z \cdot \sin y\right)}^{2}}{x - \left(\cos y - z \cdot \sin y\right)}} \]
  4. Taylor expanded in z around inf 99.9%

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification35.1%

    \[\leadsto x \]

Reproduce

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