Diagrams.ThreeD.Transform:aboutX from diagrams-lib-1.3.0.3, A

Percentage Accurate: 99.8% → 99.8%
Time: 7.9s
Alternatives: 8
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x \cdot \cos y - 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}

\\
x \cdot \cos y - 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 8 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.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \cos y - 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}

\\
x \cdot \cos y - z \cdot \sin y
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\cos y, x, \left(-z\right) \cdot \sin y\right) \end{array} \]
(FPCore (x y z) :precision binary64 (fma (cos y) x (* (- z) (sin y))))
double code(double x, double y, double z) {
	return fma(cos(y), x, (-z * sin(y)));
}
function code(x, y, z)
	return fma(cos(y), x, Float64(Float64(-z) * sin(y)))
end
code[x_, y_, z_] := N[(N[Cos[y], $MachinePrecision] * x + N[((-z) * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\cos y, x, \left(-z\right) \cdot \sin y\right)
\end{array}
Derivation
  1. Initial program 99.8%

    \[x \cdot \cos y - z \cdot \sin y \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \color{blue}{x \cdot \cos y - z \cdot \sin y} \]
    2. sub-negN/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\cos y, x, \color{blue}{\left(-z\right)} \cdot \sin y\right) \]
  4. Applied rewrites99.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, x, \left(-z\right) \cdot \sin y\right)} \]
  5. Add Preprocessing

Alternative 2: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \cos y - 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}

\\
x \cdot \cos y - z \cdot \sin y
\end{array}
Derivation
  1. Initial program 99.8%

    \[x \cdot \cos y - z \cdot \sin y \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 3: 86.8% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+52} \lor \neg \left(x \leq 1.35 \cdot 10^{+69}\right):\\
\;\;\;\;\cos y \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1e52 or 1.3499999999999999e69 < x

    1. Initial program 99.9%

      \[x \cdot \cos y - z \cdot \sin y \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{x \cdot \cos y - z \cdot \sin y} \]
      2. sub-negN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\cos y, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \sin y}\right) \]
      9. lower-neg.f6499.9

        \[\leadsto \mathsf{fma}\left(\cos y, x, \color{blue}{\left(-z\right)} \cdot \sin y\right) \]
    4. Applied rewrites99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, x, \left(-z\right) \cdot \sin y\right)} \]
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{-1 \cdot \cos y}\right)\right) + -1 \cdot \frac{z \cdot \sin y}{x}\right) \cdot x \]
      4. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \cos y \cdot x \]
    9. Step-by-step derivation
      1. Applied rewrites90.9%

        \[\leadsto \cos y \cdot x \]

      if -1.1e52 < x < 1.3499999999999999e69

      1. Initial program 99.8%

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

        \[\leadsto x \cdot \color{blue}{1} - z \cdot \sin y \]
      4. Step-by-step derivation
        1. Applied rewrites90.2%

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

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

      Alternative 4: 74.3% accurate, 1.8× speedup?

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

        1. Initial program 99.9%

          \[x \cdot \cos y - z \cdot \sin y \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift--.f64N/A

            \[\leadsto \color{blue}{x \cdot \cos y - z \cdot \sin y} \]
          2. sub-negN/A

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\cos y, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \sin y}\right) \]
          9. lower-neg.f6499.9

            \[\leadsto \mathsf{fma}\left(\cos y, x, \color{blue}{\left(-z\right)} \cdot \sin y\right) \]
        4. Applied rewrites99.9%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, x, \left(-z\right) \cdot \sin y\right)} \]
        5. Taylor expanded in x around inf

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

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

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

            \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{-1 \cdot \cos y}\right)\right) + -1 \cdot \frac{z \cdot \sin y}{x}\right) \cdot x \]
          4. neg-mul-1N/A

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

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

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

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

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

          \[\leadsto \cos y \cdot x \]
        9. Step-by-step derivation
          1. Applied rewrites85.4%

            \[\leadsto \cos y \cdot x \]

          if -0.46000000000000002 < x < 1.52000000000000001e-47

          1. Initial program 99.7%

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(-z\right) \cdot \sin y} \]
        10. Recombined 2 regimes into one program.
        11. Final simplification80.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.46 \lor \neg \left(x \leq 1.52 \cdot 10^{-47}\right):\\ \;\;\;\;\cos y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) \cdot \sin y\\ \end{array} \]
        12. Add Preprocessing

        Alternative 5: 75.5% accurate, 1.8× speedup?

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

          1. Initial program 99.6%

            \[x \cdot \cos y - z \cdot \sin y \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift--.f64N/A

              \[\leadsto \color{blue}{x \cdot \cos y - z \cdot \sin y} \]
            2. sub-negN/A

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\cos y, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \sin y}\right) \]
            9. lower-neg.f6499.6

              \[\leadsto \mathsf{fma}\left(\cos y, x, \color{blue}{\left(-z\right)} \cdot \sin y\right) \]
          4. Applied rewrites99.6%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, x, \left(-z\right) \cdot \sin y\right)} \]
          5. Taylor expanded in x around inf

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

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

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

              \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{-1 \cdot \cos y}\right)\right) + -1 \cdot \frac{z \cdot \sin y}{x}\right) \cdot x \]
            4. neg-mul-1N/A

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

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

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

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

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

            \[\leadsto \cos y \cdot x \]
          9. Step-by-step derivation
            1. Applied rewrites47.0%

              \[\leadsto \cos y \cdot x \]

            if -0.26000000000000001 < y < 1.12e-7

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.26 \lor \neg \left(y \leq 1.12 \cdot 10^{-7}\right):\\ \;\;\;\;\cos y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z \cdot y, -0.5 \cdot x\right) \cdot y - z, y, x\right)\\ \end{array} \]
          12. Add Preprocessing

          Alternative 6: 42.8% accurate, 10.7× speedup?

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

            1. Initial program 99.8%

              \[x \cdot \cos y - z \cdot \sin y \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto \color{blue}{x \cdot \cos y - z \cdot \sin y} \]
              2. sub-negN/A

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\cos y, x, \color{blue}{\left(-z\right)} \cdot \sin y\right) \]
            4. Applied rewrites99.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, x, \left(-z\right) \cdot \sin y\right)} \]
            5. Taylor expanded in x around inf

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

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

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

                \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{-1 \cdot \cos y}\right)\right) + -1 \cdot \frac{z \cdot \sin y}{x}\right) \cdot x \]
              4. neg-mul-1N/A

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

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

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

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

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

              \[\leadsto 1 \cdot x \]
            9. Step-by-step derivation
              1. Applied rewrites47.0%

                \[\leadsto 1 \cdot x \]

              if -7.19999999999999969e-165 < x < 3.40000000000000021e-160

              1. Initial program 99.8%

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

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

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

                  \[\leadsto \color{blue}{x - y \cdot z} \]
                3. lower--.f64N/A

                  \[\leadsto \color{blue}{x - y \cdot z} \]
                4. *-commutativeN/A

                  \[\leadsto x - \color{blue}{z \cdot y} \]
                5. lower-*.f6442.6

                  \[\leadsto x - \color{blue}{z \cdot y} \]
              5. Applied rewrites42.6%

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

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

                  \[\leadsto \left(-y\right) \cdot \color{blue}{z} \]
              8. Recombined 2 regimes into one program.
              9. Final simplification43.8%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-165} \lor \neg \left(x \leq 3.4 \cdot 10^{-160}\right):\\ \;\;\;\;1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(-y\right) \cdot z\\ \end{array} \]
              10. Add Preprocessing

              Alternative 7: 53.4% accurate, 23.8× speedup?

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

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

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

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

                  \[\leadsto \color{blue}{x - y \cdot z} \]
                3. lower--.f64N/A

                  \[\leadsto \color{blue}{x - y \cdot z} \]
                4. *-commutativeN/A

                  \[\leadsto x - \color{blue}{z \cdot y} \]
                5. lower-*.f6448.9

                  \[\leadsto x - \color{blue}{z \cdot y} \]
              5. Applied rewrites48.9%

                \[\leadsto \color{blue}{x - z \cdot y} \]
              6. Add Preprocessing

              Alternative 8: 39.5% accurate, 35.7× speedup?

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

                \[x \cdot \cos y - z \cdot \sin y \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift--.f64N/A

                  \[\leadsto \color{blue}{x \cdot \cos y - z \cdot \sin y} \]
                2. sub-negN/A

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\cos y, x, \color{blue}{\left(-z\right)} \cdot \sin y\right) \]
              4. Applied rewrites99.8%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, x, \left(-z\right) \cdot \sin y\right)} \]
              5. Taylor expanded in x around inf

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

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

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

                  \[\leadsto \left(\left(\mathsf{neg}\left(\color{blue}{-1 \cdot \cos y}\right)\right) + -1 \cdot \frac{z \cdot \sin y}{x}\right) \cdot x \]
                4. neg-mul-1N/A

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

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

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

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

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

                \[\leadsto 1 \cdot x \]
              9. Step-by-step derivation
                1. Applied rewrites38.8%

                  \[\leadsto 1 \cdot x \]
                2. Final simplification38.8%

                  \[\leadsto 1 \cdot x \]
                3. Add Preprocessing

                Reproduce

                ?
                herbie shell --seed 2024313 
                (FPCore (x y z)
                  :name "Diagrams.ThreeD.Transform:aboutX from diagrams-lib-1.3.0.3, A"
                  :precision binary64
                  (- (* x (cos y)) (* z (sin y))))