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

Percentage Accurate: 99.8% → 99.8%
Time: 9.9s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 99.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, \sin y \cdot \left(-z\right)\right) \end{array} \]
(FPCore (x y z) :precision binary64 (fma (cos y) x (* (sin y) (- z))))
double code(double x, double y, double z) {
	return fma(cos(y), x, (sin(y) * -z));
}
function code(x, y, z)
	return fma(cos(y), x, Float64(sin(y) * Float64(-z)))
end
code[x_, y_, z_] := N[(N[Cos[y], $MachinePrecision] * x + N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\cos y, x, \sin y \cdot \left(-z\right)\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. Final simplification99.8%

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

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

    \[x \cdot \cos y - z \cdot \sin y \]
  2. Add Preprocessing
  3. Final simplification99.8%

    \[\leadsto x \cdot \cos y - \sin y \cdot z \]
  4. Add Preprocessing

Alternative 3: 87.4% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\cos y, x, \frac{-1}{\frac{\mathsf{fma}\left(\frac{y \cdot y}{z}, 0.16666666666666666, \frac{1}{z}\right)}{y}}\right)\\
\mathbf{if}\;x \leq -29000000:\\
\;\;\;\;t\_0\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.9e7 or 9.99999999999999995e-56 < 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.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. Applied rewrites99.8%

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

      \[\leadsto \mathsf{fma}\left(\cos y, x, \frac{-1}{\color{blue}{\frac{\frac{1}{6} \cdot \frac{{y}^{2}}{z} + \frac{1}{z}}{y}}}\right) \]
    7. Step-by-step derivation
      1. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\cos y, x, \frac{-1}{\frac{\mathsf{fma}\left(\color{blue}{\frac{{y}^{2}}{z}}, \frac{1}{6}, \frac{1}{z}\right)}{y}}\right) \]
      13. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\cos y, x, \frac{-1}{\frac{\mathsf{fma}\left(\frac{\color{blue}{y \cdot y}}{z}, \frac{1}{6}, \frac{1}{z}\right)}{y}}\right) \]
      15. lower-/.f6489.3

        \[\leadsto \mathsf{fma}\left(\cos y, x, \frac{-1}{\frac{\mathsf{fma}\left(\frac{y \cdot y}{z}, 0.16666666666666666, \color{blue}{\frac{1}{z}}\right)}{y}}\right) \]
    8. Applied rewrites89.3%

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

    if -2.9e7 < x < 9.99999999999999995e-56

    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 rewrites92.6%

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

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

    Alternative 4: 82.7% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \cos y - z \cdot y\\ \mathbf{if}\;x \leq -4.9 \cdot 10^{+122}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+160}:\\ \;\;\;\;\mathsf{fma}\left(\sin y, -z, 1 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (- (* x (cos y)) (* z y))))
       (if (<= x -4.9e+122)
         t_0
         (if (<= x 1.6e+160) (fma (sin y) (- z) (* 1.0 x)) t_0))))
    double code(double x, double y, double z) {
    	double t_0 = (x * cos(y)) - (z * y);
    	double tmp;
    	if (x <= -4.9e+122) {
    		tmp = t_0;
    	} else if (x <= 1.6e+160) {
    		tmp = fma(sin(y), -z, (1.0 * x));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	t_0 = Float64(Float64(x * cos(y)) - Float64(z * y))
    	tmp = 0.0
    	if (x <= -4.9e+122)
    		tmp = t_0;
    	elseif (x <= 1.6e+160)
    		tmp = fma(sin(y), Float64(-z), Float64(1.0 * x));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e+122], t$95$0, If[LessEqual[x, 1.6e+160], N[(N[Sin[y], $MachinePrecision] * (-z) + N[(1.0 * x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x \cdot \cos y - z \cdot y\\
    \mathbf{if}\;x \leq -4.9 \cdot 10^{+122}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq 1.6 \cdot 10^{+160}:\\
    \;\;\;\;\mathsf{fma}\left(\sin y, -z, 1 \cdot x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -4.8999999999999998e122 or 1.5999999999999999e160 < x

      1. Initial program 99.9%

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

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

          \[\leadsto x \cdot \cos y - \color{blue}{z \cdot y} \]
        2. lower-*.f6475.4

          \[\leadsto x \cdot \cos y - \color{blue}{z \cdot y} \]
      5. Applied rewrites75.4%

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

      if -4.8999999999999998e122 < x < 1.5999999999999999e160

      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 rewrites83.8%

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

            \[\leadsto \color{blue}{x \cdot 1 - z \cdot \sin y} \]
          2. lift-*.f64N/A

            \[\leadsto x \cdot 1 - \color{blue}{z \cdot \sin y} \]
          3. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\sin y, -z, 1 \cdot x\right)} \]
      5. Recombined 2 regimes into one program.
      6. Add Preprocessing

      Alternative 5: 82.7% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \cos y - z \cdot y\\ \mathbf{if}\;x \leq -4.9 \cdot 10^{+122}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+160}:\\ \;\;\;\;1 \cdot x - \sin y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (- (* x (cos y)) (* z y))))
         (if (<= x -4.9e+122)
           t_0
           (if (<= x 1.6e+160) (- (* 1.0 x) (* (sin y) z)) t_0))))
      double code(double x, double y, double z) {
      	double t_0 = (x * cos(y)) - (z * y);
      	double tmp;
      	if (x <= -4.9e+122) {
      		tmp = t_0;
      	} else if (x <= 1.6e+160) {
      		tmp = (1.0 * x) - (sin(y) * z);
      	} else {
      		tmp = 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 = (x * cos(y)) - (z * y)
          if (x <= (-4.9d+122)) then
              tmp = t_0
          else if (x <= 1.6d+160) then
              tmp = (1.0d0 * x) - (sin(y) * z)
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = (x * Math.cos(y)) - (z * y);
      	double tmp;
      	if (x <= -4.9e+122) {
      		tmp = t_0;
      	} else if (x <= 1.6e+160) {
      		tmp = (1.0 * x) - (Math.sin(y) * z);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = (x * math.cos(y)) - (z * y)
      	tmp = 0
      	if x <= -4.9e+122:
      		tmp = t_0
      	elif x <= 1.6e+160:
      		tmp = (1.0 * x) - (math.sin(y) * z)
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(Float64(x * cos(y)) - Float64(z * y))
      	tmp = 0.0
      	if (x <= -4.9e+122)
      		tmp = t_0;
      	elseif (x <= 1.6e+160)
      		tmp = Float64(Float64(1.0 * x) - Float64(sin(y) * z));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = (x * cos(y)) - (z * y);
      	tmp = 0.0;
      	if (x <= -4.9e+122)
      		tmp = t_0;
      	elseif (x <= 1.6e+160)
      		tmp = (1.0 * x) - (sin(y) * z);
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e+122], t$95$0, If[LessEqual[x, 1.6e+160], N[(N[(1.0 * x), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x \cdot \cos y - z \cdot y\\
      \mathbf{if}\;x \leq -4.9 \cdot 10^{+122}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x \leq 1.6 \cdot 10^{+160}:\\
      \;\;\;\;1 \cdot x - \sin y \cdot z\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -4.8999999999999998e122 or 1.5999999999999999e160 < x

        1. Initial program 99.9%

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

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

            \[\leadsto x \cdot \cos y - \color{blue}{z \cdot y} \]
          2. lower-*.f6475.4

            \[\leadsto x \cdot \cos y - \color{blue}{z \cdot y} \]
        5. Applied rewrites75.4%

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

        if -4.8999999999999998e122 < x < 1.5999999999999999e160

        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 rewrites83.8%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{+122}:\\ \;\;\;\;x \cdot \cos y - z \cdot y\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+160}:\\ \;\;\;\;1 \cdot x - \sin y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \cos y - z \cdot y\\ \end{array} \]
        7. Add Preprocessing

        Alternative 6: 74.6% accurate, 1.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin y \cdot \left(-z\right)\\ \mathbf{if}\;y \leq -0.0105:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 720000:\\ \;\;\;\;1 \cdot x - \left(\mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right) \cdot z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (let* ((t_0 (* (sin y) (- z))))
           (if (<= y -0.0105)
             t_0
             (if (<= y 720000.0)
               (- (* 1.0 x) (* (* (fma -0.16666666666666666 (* y y) 1.0) z) y))
               t_0))))
        double code(double x, double y, double z) {
        	double t_0 = sin(y) * -z;
        	double tmp;
        	if (y <= -0.0105) {
        		tmp = t_0;
        	} else if (y <= 720000.0) {
        		tmp = (1.0 * x) - ((fma(-0.16666666666666666, (y * y), 1.0) * z) * y);
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	t_0 = Float64(sin(y) * Float64(-z))
        	tmp = 0.0
        	if (y <= -0.0105)
        		tmp = t_0;
        	elseif (y <= 720000.0)
        		tmp = Float64(Float64(1.0 * x) - Float64(Float64(fma(-0.16666666666666666, Float64(y * y), 1.0) * z) * y));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision]}, If[LessEqual[y, -0.0105], t$95$0, If[LessEqual[y, 720000.0], N[(N[(1.0 * x), $MachinePrecision] - N[(N[(N[(-0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \sin y \cdot \left(-z\right)\\
        \mathbf{if}\;y \leq -0.0105:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;y \leq 720000:\\
        \;\;\;\;1 \cdot x - \left(\mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right) \cdot z\right) \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -0.0105000000000000007 or 7.2e5 < y

          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.f6450.8

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

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

          if -0.0105000000000000007 < y < 7.2e5

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                \[\leadsto x \cdot 1 - \left(z + \color{blue}{\left(\frac{-1}{6} \cdot {y}^{2}\right) \cdot z}\right) \cdot y \]
              8. distribute-rgt1-inN/A

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

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

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.0105:\\ \;\;\;\;\sin y \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq 720000:\\ \;\;\;\;1 \cdot x - \left(\mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right) \cdot z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\sin y \cdot \left(-z\right)\\ \end{array} \]
          7. Add Preprocessing

          Alternative 7: 76.7% accurate, 1.9× speedup?

          \[\begin{array}{l} \\ 1 \cdot x - \sin y \cdot z \end{array} \]
          (FPCore (x y z) :precision binary64 (- (* 1.0 x) (* (sin y) z)))
          double code(double x, double y, double z) {
          	return (1.0 * x) - (sin(y) * z);
          }
          
          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) - (sin(y) * z)
          end function
          
          public static double code(double x, double y, double z) {
          	return (1.0 * x) - (Math.sin(y) * z);
          }
          
          def code(x, y, z):
          	return (1.0 * x) - (math.sin(y) * z)
          
          function code(x, y, z)
          	return Float64(Float64(1.0 * x) - Float64(sin(y) * z))
          end
          
          function tmp = code(x, y, z)
          	tmp = (1.0 * x) - (sin(y) * z);
          end
          
          code[x_, y_, z_] := N[(N[(1.0 * x), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          1 \cdot x - \sin y \cdot z
          \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 x \cdot \color{blue}{1} - z \cdot \sin y \]
          4. Step-by-step derivation
            1. Applied rewrites75.4%

              \[\leadsto x \cdot \color{blue}{1} - z \cdot \sin y \]
            2. Final simplification75.4%

              \[\leadsto 1 \cdot x - \sin y \cdot z \]
            3. Add Preprocessing

            Alternative 8: 40.4% accurate, 10.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-y\right) \cdot z\\ \mathbf{if}\;z \leq -5.8 \cdot 10^{+86}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+188}:\\ \;\;\;\;\mathsf{fma}\left(y, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (* (- y) z)))
               (if (<= z -5.8e+86) t_0 (if (<= z 3.7e+188) (fma y z x) t_0))))
            double code(double x, double y, double z) {
            	double t_0 = -y * z;
            	double tmp;
            	if (z <= -5.8e+86) {
            		tmp = t_0;
            	} else if (z <= 3.7e+188) {
            		tmp = fma(y, z, x);
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	t_0 = Float64(Float64(-y) * z)
            	tmp = 0.0
            	if (z <= -5.8e+86)
            		tmp = t_0;
            	elseif (z <= 3.7e+188)
            		tmp = fma(y, z, x);
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[((-y) * z), $MachinePrecision]}, If[LessEqual[z, -5.8e+86], t$95$0, If[LessEqual[z, 3.7e+188], N[(y * z + x), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(-y\right) \cdot z\\
            \mathbf{if}\;z \leq -5.8 \cdot 10^{+86}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;z \leq 3.7 \cdot 10^{+188}:\\
            \;\;\;\;\mathsf{fma}\left(y, z, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -5.79999999999999981e86 or 3.7e188 < z

              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-*.f6449.8

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

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

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

                if -5.79999999999999981e86 < z < 3.7e188

                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 rewrites68.9%

                    \[\leadsto x \cdot \color{blue}{1} - z \cdot \sin y \]
                  2. Applied rewrites44.9%

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

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

                      \[\leadsto \color{blue}{y \cdot z + x} \]
                    2. lower-fma.f6444.6

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right)} \]
                5. Recombined 2 regimes into one program.
                6. Add Preprocessing

                Alternative 9: 51.9% 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-*.f6449.3

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

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

                Alternative 10: 37.5% accurate, 30.6× speedup?

                \[\begin{array}{l} \\ \mathsf{fma}\left(y, z, x\right) \end{array} \]
                (FPCore (x y z) :precision binary64 (fma y z x))
                double code(double x, double y, double z) {
                	return fma(y, z, x);
                }
                
                function code(x, y, z)
                	return fma(y, z, x)
                end
                
                code[x_, y_, z_] := N[(y * z + x), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \mathsf{fma}\left(y, z, x\right)
                \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 x \cdot \color{blue}{1} - z \cdot \sin y \]
                4. Step-by-step derivation
                  1. Applied rewrites75.4%

                    \[\leadsto x \cdot \color{blue}{1} - z \cdot \sin y \]
                  2. Applied rewrites35.4%

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

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

                      \[\leadsto \color{blue}{y \cdot z + x} \]
                    2. lower-fma.f6435.4

                      \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right)} \]
                  5. Applied rewrites35.4%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, z, x\right)} \]
                  6. Add Preprocessing

                  Reproduce

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