VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.3% → 99.0%
Time: 13.1s
Alternatives: 23
Speedup: 2.2×

Specification

?
\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\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 23 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: 77.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}

Alternative 1: 99.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\ \;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 10^{+147}:\\ \;\;\;\;\mathsf{fma}\left(F, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot t\_0, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 - \frac{x}{\sin B} \cdot \cos B\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ 1.0 (sin B))))
   (if (<= F -1.2e+167)
     (/ (- -1.0 (* (cos B) x)) (sin B))
     (if (<= F 1e+147)
       (fma F (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) t_0) (/ (- x) (tan B)))
       (- t_0 (* (/ x (sin B)) (cos B)))))))
double code(double F, double B, double x) {
	double t_0 = 1.0 / sin(B);
	double tmp;
	if (F <= -1.2e+167) {
		tmp = (-1.0 - (cos(B) * x)) / sin(B);
	} else if (F <= 1e+147) {
		tmp = fma(F, (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * t_0), (-x / tan(B)));
	} else {
		tmp = t_0 - ((x / sin(B)) * cos(B));
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(1.0 / sin(B))
	tmp = 0.0
	if (F <= -1.2e+167)
		tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B));
	elseif (F <= 1e+147)
		tmp = fma(F, Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * t_0), Float64(Float64(-x) / tan(B)));
	else
		tmp = Float64(t_0 - Float64(Float64(x / sin(B)) * cos(B)));
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e+167], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+147], N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * t$95$0), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\

\mathbf{elif}\;F \leq 10^{+147}:\\
\;\;\;\;\mathsf{fma}\left(F, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot t\_0, \frac{-x}{\tan B}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 - \frac{x}{\sin B} \cdot \cos B\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.19999999999999999e167

    1. Initial program 30.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
      3. distribute-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
      4. associate-/l*N/A

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
      7. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
      9. lower-cos.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
      10. lower-sin.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
      14. lower-sin.f6499.8

        \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
    5. Applied rewrites99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites99.9%

        \[\leadsto \frac{-1 - \cos B \cdot x}{\color{blue}{\sin B}} \]

      if -1.19999999999999999e167 < F < 9.9999999999999998e146

      1. Initial program 94.2%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        4. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        5. div-invN/A

          \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        6. associate-*l*N/A

          \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        7. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      4. Applied rewrites99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]

      if 9.9999999999999998e146 < F

      1. Initial program 24.7%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around inf

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. Step-by-step derivation
        1. lower--.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
        2. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x \cdot \cos B}{\sin B} \]
        3. lower-sin.f64N/A

          \[\leadsto \frac{1}{\color{blue}{\sin B}} - \frac{x \cdot \cos B}{\sin B} \]
        4. *-commutativeN/A

          \[\leadsto \frac{1}{\sin B} - \frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
        5. associate-/l*N/A

          \[\leadsto \frac{1}{\sin B} - \color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
        6. lower-*.f64N/A

          \[\leadsto \frac{1}{\sin B} - \color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
        7. lower-cos.f64N/A

          \[\leadsto \frac{1}{\sin B} - \color{blue}{\cos B} \cdot \frac{x}{\sin B} \]
        8. lower-/.f64N/A

          \[\leadsto \frac{1}{\sin B} - \cos B \cdot \color{blue}{\frac{x}{\sin B}} \]
        9. lower-sin.f6499.9

          \[\leadsto \frac{1}{\sin B} - \cos B \cdot \frac{x}{\color{blue}{\sin B}} \]
      5. Applied rewrites99.9%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
    7. Recombined 3 regimes into one program.
    8. Final simplification99.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\ \;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 10^{+147}:\\ \;\;\;\;\mathsf{fma}\left(F, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{1}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B\\ \end{array} \]
    9. Add Preprocessing

    Alternative 2: 99.7% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -320000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 110000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (let* ((t_0 (/ (- x) (tan B))))
       (if (<= F -320000000.0)
         (- (/ -1.0 (sin B)) (/ x (tan B)))
         (if (<= F 110000000.0)
           (fma (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) F t_0)
           (fma (/ 1.0 (sin B)) 1.0 t_0)))))
    double code(double F, double B, double x) {
    	double t_0 = -x / tan(B);
    	double tmp;
    	if (F <= -320000000.0) {
    		tmp = (-1.0 / sin(B)) - (x / tan(B));
    	} else if (F <= 110000000.0) {
    		tmp = fma((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), F, t_0);
    	} else {
    		tmp = fma((1.0 / sin(B)), 1.0, t_0);
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	t_0 = Float64(Float64(-x) / tan(B))
    	tmp = 0.0
    	if (F <= -320000000.0)
    		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
    	elseif (F <= 110000000.0)
    		tmp = fma(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, t_0);
    	else
    		tmp = fma(Float64(1.0 / sin(B)), 1.0, t_0);
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -320000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 110000000.0], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + t$95$0), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{-x}{\tan B}\\
    \mathbf{if}\;F \leq -320000000:\\
    \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
    
    \mathbf{elif}\;F \leq 110000000:\\
    \;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, t\_0\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -3.2e8

      1. Initial program 54.4%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around -inf

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

          \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
        3. distribute-neg-inN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
        4. associate-/l*N/A

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
        6. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
        7. lower-neg.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
        8. lower-/.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
        9. lower-cos.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
        10. lower-sin.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
        11. distribute-neg-fracN/A

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
        12. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
        13. lower-/.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
        14. lower-sin.f6499.7

          \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
      5. Applied rewrites99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\sin B}\right)} \]
      6. Step-by-step derivation
        1. Applied rewrites99.9%

          \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]

        if -3.2e8 < F < 1.1e8

        1. Initial program 99.3%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          5. lift-/.f64N/A

            \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          6. clear-numN/A

            \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          7. associate-/r/N/A

            \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          8. associate-*r*N/A

            \[\leadsto \color{blue}{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot F} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          9. div-invN/A

            \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \cdot F + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          10. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}, F, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
        4. Applied rewrites99.6%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]

        if 1.1e8 < F

        1. Initial program 54.1%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          4. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          5. div-invN/A

            \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          6. associate-*l*N/A

            \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          7. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
        4. Applied rewrites70.9%

          \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
        5. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) + \frac{\mathsf{neg}\left(x\right)}{\tan B}} \]
          2. lift-*.f64N/A

            \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right)} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
          3. associate-*r*N/A

            \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
          4. lift-/.f64N/A

            \[\leadsto \left(F \cdot \color{blue}{\frac{1}{\sin B}}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
          5. div-invN/A

            \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
          6. clear-numN/A

            \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{F}}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
          7. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
          8. div-invN/A

            \[\leadsto \frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\color{blue}{\sin B \cdot \frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
          9. times-fracN/A

            \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
          10. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{1}{\sin B}} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
          11. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right)} \]
        6. Applied rewrites70.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\frac{1}{F}}, \frac{-x}{\tan B}\right)} \]
        7. Taylor expanded in F around inf

          \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
        8. Step-by-step derivation
          1. Applied rewrites99.8%

            \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{-x}{\tan B}\right) \]
        9. Recombined 3 regimes into one program.
        10. Add Preprocessing

        Alternative 3: 99.0% accurate, 1.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sin B}\\ t_1 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\ \;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 105000000:\\ \;\;\;\;\mathsf{fma}\left(t\_0, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\frac{1}{F}}, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
           (if (<= F -1.2e+167)
             (/ (- -1.0 (* (cos B) x)) (sin B))
             (if (<= F 105000000.0)
               (fma t_0 (/ (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ 1.0 F)) t_1)
               (fma t_0 1.0 t_1)))))
        double code(double F, double B, double x) {
        	double t_0 = 1.0 / sin(B);
        	double t_1 = -x / tan(B);
        	double tmp;
        	if (F <= -1.2e+167) {
        		tmp = (-1.0 - (cos(B) * x)) / sin(B);
        	} else if (F <= 105000000.0) {
        		tmp = fma(t_0, (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) / (1.0 / F)), t_1);
        	} else {
        		tmp = fma(t_0, 1.0, t_1);
        	}
        	return tmp;
        }
        
        function code(F, B, x)
        	t_0 = Float64(1.0 / sin(B))
        	t_1 = Float64(Float64(-x) / tan(B))
        	tmp = 0.0
        	if (F <= -1.2e+167)
        		tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B));
        	elseif (F <= 105000000.0)
        		tmp = fma(t_0, Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) / Float64(1.0 / F)), t_1);
        	else
        		tmp = fma(t_0, 1.0, t_1);
        	end
        	return tmp
        end
        
        code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e+167], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 105000000.0], N[(t$95$0 * N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / F), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{1}{\sin B}\\
        t_1 := \frac{-x}{\tan B}\\
        \mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\
        \;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
        
        \mathbf{elif}\;F \leq 105000000:\\
        \;\;\;\;\mathsf{fma}\left(t\_0, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\frac{1}{F}}, t\_1\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if F < -1.19999999999999999e167

          1. Initial program 30.1%

            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in F around -inf

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

              \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
            2. +-commutativeN/A

              \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
            3. distribute-neg-inN/A

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
            4. associate-/l*N/A

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

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
            6. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
            7. lower-neg.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
            8. lower-/.f64N/A

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
            9. lower-cos.f64N/A

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
            10. lower-sin.f64N/A

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
            11. distribute-neg-fracN/A

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
            12. metadata-evalN/A

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
            13. lower-/.f64N/A

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
            14. lower-sin.f6499.8

              \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
          5. Applied rewrites99.8%

            \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\sin B}\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites99.9%

              \[\leadsto \frac{-1 - \cos B \cdot x}{\color{blue}{\sin B}} \]

            if -1.19999999999999999e167 < F < 1.05e8

            1. Initial program 94.9%

              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
              2. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
              3. lift-*.f64N/A

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              4. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              5. div-invN/A

                \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              6. associate-*l*N/A

                \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              7. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
            4. Applied rewrites99.6%

              \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
            5. Step-by-step derivation
              1. lift-fma.f64N/A

                \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) + \frac{\mathsf{neg}\left(x\right)}{\tan B}} \]
              2. lift-*.f64N/A

                \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right)} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              3. associate-*r*N/A

                \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              4. lift-/.f64N/A

                \[\leadsto \left(F \cdot \color{blue}{\frac{1}{\sin B}}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              5. div-invN/A

                \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              6. clear-numN/A

                \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{F}}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              7. associate-*l/N/A

                \[\leadsto \color{blue}{\frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              8. div-invN/A

                \[\leadsto \frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\color{blue}{\sin B \cdot \frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              9. times-fracN/A

                \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              10. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{1}{\sin B}} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              11. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right)} \]
            6. Applied rewrites99.6%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\frac{1}{F}}, \frac{-x}{\tan B}\right)} \]

            if 1.05e8 < F

            1. Initial program 54.1%

              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
              2. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
              3. lift-*.f64N/A

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              4. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              5. div-invN/A

                \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              6. associate-*l*N/A

                \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              7. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
            4. Applied rewrites70.9%

              \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
            5. Step-by-step derivation
              1. lift-fma.f64N/A

                \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) + \frac{\mathsf{neg}\left(x\right)}{\tan B}} \]
              2. lift-*.f64N/A

                \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right)} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              3. associate-*r*N/A

                \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              4. lift-/.f64N/A

                \[\leadsto \left(F \cdot \color{blue}{\frac{1}{\sin B}}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              5. div-invN/A

                \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              6. clear-numN/A

                \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{F}}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              7. associate-*l/N/A

                \[\leadsto \color{blue}{\frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              8. div-invN/A

                \[\leadsto \frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\color{blue}{\sin B \cdot \frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              9. times-fracN/A

                \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              10. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{1}{\sin B}} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
              11. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right)} \]
            6. Applied rewrites70.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\frac{1}{F}}, \frac{-x}{\tan B}\right)} \]
            7. Taylor expanded in F around inf

              \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
            8. Step-by-step derivation
              1. Applied rewrites99.8%

                \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{-x}{\tan B}\right) \]
            9. Recombined 3 regimes into one program.
            10. Add Preprocessing

            Alternative 4: 99.7% accurate, 1.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2 \cdot 10^{+22}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 105000000:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, \frac{-x}{\tan B}\right)\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (if (<= F -2e+22)
               (- (/ -1.0 (sin B)) (/ x (tan B)))
               (if (<= F 105000000.0)
                 (/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (* (cos B) x)) (sin B))
                 (fma (/ 1.0 (sin B)) 1.0 (/ (- x) (tan B))))))
            double code(double F, double B, double x) {
            	double tmp;
            	if (F <= -2e+22) {
            		tmp = (-1.0 / sin(B)) - (x / tan(B));
            	} else if (F <= 105000000.0) {
            		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - (cos(B) * x)) / sin(B);
            	} else {
            		tmp = fma((1.0 / sin(B)), 1.0, (-x / tan(B)));
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	tmp = 0.0
            	if (F <= -2e+22)
            		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
            	elseif (F <= 105000000.0)
            		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - Float64(cos(B) * x)) / sin(B));
            	else
            		tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(Float64(-x) / tan(B)));
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := If[LessEqual[F, -2e+22], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 105000000.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;F \leq -2 \cdot 10^{+22}:\\
            \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
            
            \mathbf{elif}\;F \leq 105000000:\\
            \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, \frac{-x}{\tan B}\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if F < -2e22

              1. Initial program 53.6%

                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in F around -inf

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

                  \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                2. +-commutativeN/A

                  \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
                3. distribute-neg-inN/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                4. associate-/l*N/A

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

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                6. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                7. lower-neg.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                8. lower-/.f64N/A

                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                9. lower-cos.f64N/A

                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                10. lower-sin.f64N/A

                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                11. distribute-neg-fracN/A

                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
                12. metadata-evalN/A

                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
                13. lower-/.f64N/A

                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
                14. lower-sin.f6499.7

                  \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
              5. Applied rewrites99.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\sin B}\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites99.9%

                  \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]

                if -2e22 < F < 1.05e8

                1. Initial program 99.3%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                  2. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                  3. lift-*.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  4. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  5. div-invN/A

                    \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  6. associate-*l*N/A

                    \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  7. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                4. Applied rewrites99.6%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
                5. Applied rewrites99.5%

                  \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}} \]

                if 1.05e8 < F

                1. Initial program 54.1%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                  2. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                  3. lift-*.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  4. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  5. div-invN/A

                    \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  6. associate-*l*N/A

                    \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  7. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                4. Applied rewrites70.9%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
                5. Step-by-step derivation
                  1. lift-fma.f64N/A

                    \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) + \frac{\mathsf{neg}\left(x\right)}{\tan B}} \]
                  2. lift-*.f64N/A

                    \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right)} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                  3. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                  4. lift-/.f64N/A

                    \[\leadsto \left(F \cdot \color{blue}{\frac{1}{\sin B}}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                  5. div-invN/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                  6. clear-numN/A

                    \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{F}}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                  7. associate-*l/N/A

                    \[\leadsto \color{blue}{\frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                  8. div-invN/A

                    \[\leadsto \frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\color{blue}{\sin B \cdot \frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                  9. times-fracN/A

                    \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                  10. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{1}{\sin B}} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                  11. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right)} \]
                6. Applied rewrites70.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\frac{1}{F}}, \frac{-x}{\tan B}\right)} \]
                7. Taylor expanded in F around inf

                  \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                8. Step-by-step derivation
                  1. Applied rewrites99.8%

                    \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{-x}{\tan B}\right) \]
                9. Recombined 3 regimes into one program.
                10. Add Preprocessing

                Alternative 5: 99.2% accurate, 1.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - \cos B \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, \frac{-x}{\tan B}\right)\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (if (<= F -1.4)
                   (- (/ -1.0 (sin B)) (/ x (tan B)))
                   (if (<= F 1.4)
                     (/ (- (/ F (sqrt (fma x 2.0 2.0))) (* (cos B) x)) (sin B))
                     (fma (/ 1.0 (sin B)) 1.0 (/ (- x) (tan B))))))
                double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -1.4) {
                		tmp = (-1.0 / sin(B)) - (x / tan(B));
                	} else if (F <= 1.4) {
                		tmp = ((F / sqrt(fma(x, 2.0, 2.0))) - (cos(B) * x)) / sin(B);
                	} else {
                		tmp = fma((1.0 / sin(B)), 1.0, (-x / tan(B)));
                	}
                	return tmp;
                }
                
                function code(F, B, x)
                	tmp = 0.0
                	if (F <= -1.4)
                		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
                	elseif (F <= 1.4)
                		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, 2.0))) - Float64(cos(B) * x)) / sin(B));
                	else
                		tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(Float64(-x) / tan(B)));
                	end
                	return tmp
                end
                
                code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;F \leq -1.4:\\
                \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
                
                \mathbf{elif}\;F \leq 1.4:\\
                \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - \cos B \cdot x}{\sin B}\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, \frac{-x}{\tan B}\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if F < -1.3999999999999999

                  1. Initial program 54.4%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in F around -inf

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

                      \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                    2. +-commutativeN/A

                      \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
                    3. distribute-neg-inN/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                    4. associate-/l*N/A

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

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                    6. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                    7. lower-neg.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                    8. lower-/.f64N/A

                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                    9. lower-cos.f64N/A

                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                    10. lower-sin.f64N/A

                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                    11. distribute-neg-fracN/A

                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
                    12. metadata-evalN/A

                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
                    13. lower-/.f64N/A

                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
                    14. lower-sin.f6499.7

                      \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
                  5. Applied rewrites99.7%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\sin B}\right)} \]
                  6. Step-by-step derivation
                    1. Applied rewrites99.9%

                      \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]

                    if -1.3999999999999999 < F < 1.3999999999999999

                    1. Initial program 99.3%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                      2. +-commutativeN/A

                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                      3. lift-*.f64N/A

                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      4. lift-/.f64N/A

                        \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      5. div-invN/A

                        \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      6. associate-*l*N/A

                        \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      7. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                    4. Applied rewrites99.6%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
                    5. Applied rewrites99.5%

                      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}} \]
                    6. Taylor expanded in F around 0

                      \[\leadsto \frac{\frac{F}{\color{blue}{\sqrt{2 + 2 \cdot x}}} - \cos B \cdot x}{\sin B} \]
                    7. Step-by-step derivation
                      1. lower-sqrt.f64N/A

                        \[\leadsto \frac{\frac{F}{\color{blue}{\sqrt{2 + 2 \cdot x}}} - \cos B \cdot x}{\sin B} \]
                      2. +-commutativeN/A

                        \[\leadsto \frac{\frac{F}{\sqrt{\color{blue}{2 \cdot x + 2}}} - \cos B \cdot x}{\sin B} \]
                      3. *-commutativeN/A

                        \[\leadsto \frac{\frac{F}{\sqrt{\color{blue}{x \cdot 2} + 2}} - \cos B \cdot x}{\sin B} \]
                      4. lower-fma.f6498.0

                        \[\leadsto \frac{\frac{F}{\sqrt{\color{blue}{\mathsf{fma}\left(x, 2, 2\right)}}} - \cos B \cdot x}{\sin B} \]
                    8. Applied rewrites98.0%

                      \[\leadsto \frac{\frac{F}{\color{blue}{\sqrt{\mathsf{fma}\left(x, 2, 2\right)}}} - \cos B \cdot x}{\sin B} \]

                    if 1.3999999999999999 < F

                    1. Initial program 54.7%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                      2. +-commutativeN/A

                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                      3. lift-*.f64N/A

                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      4. lift-/.f64N/A

                        \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      5. div-invN/A

                        \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      6. associate-*l*N/A

                        \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      7. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                    4. Applied rewrites71.3%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
                    5. Step-by-step derivation
                      1. lift-fma.f64N/A

                        \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) + \frac{\mathsf{neg}\left(x\right)}{\tan B}} \]
                      2. lift-*.f64N/A

                        \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right)} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                      3. associate-*r*N/A

                        \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                      4. lift-/.f64N/A

                        \[\leadsto \left(F \cdot \color{blue}{\frac{1}{\sin B}}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                      5. div-invN/A

                        \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                      6. clear-numN/A

                        \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{F}}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                      7. associate-*l/N/A

                        \[\leadsto \color{blue}{\frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                      8. div-invN/A

                        \[\leadsto \frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\color{blue}{\sin B \cdot \frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                      9. times-fracN/A

                        \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                      10. lift-/.f64N/A

                        \[\leadsto \color{blue}{\frac{1}{\sin B}} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                      11. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right)} \]
                    6. Applied rewrites71.2%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\frac{1}{F}}, \frac{-x}{\tan B}\right)} \]
                    7. Taylor expanded in F around inf

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                    8. Step-by-step derivation
                      1. Applied rewrites99.6%

                        \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{-x}{\tan B}\right) \]
                    9. Recombined 3 regimes into one program.
                    10. Add Preprocessing

                    Alternative 6: 92.3% accurate, 1.5× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2500:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1550:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, \frac{-x}{\tan B}\right)\\ \end{array} \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (if (<= F -2500.0)
                       (- (/ -1.0 (sin B)) (/ x (tan B)))
                       (if (<= F 1550.0)
                         (+
                          (* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
                          (* (/ -1.0 (tan B)) x))
                         (fma (/ 1.0 (sin B)) 1.0 (/ (- x) (tan B))))))
                    double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -2500.0) {
                    		tmp = (-1.0 / sin(B)) - (x / tan(B));
                    	} else if (F <= 1550.0) {
                    		tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
                    	} else {
                    		tmp = fma((1.0 / sin(B)), 1.0, (-x / tan(B)));
                    	}
                    	return tmp;
                    }
                    
                    function code(F, B, x)
                    	tmp = 0.0
                    	if (F <= -2500.0)
                    		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
                    	elseif (F <= 1550.0)
                    		tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x));
                    	else
                    		tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(Float64(-x) / tan(B)));
                    	end
                    	return tmp
                    end
                    
                    code[F_, B_, x_] := If[LessEqual[F, -2500.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1550.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;F \leq -2500:\\
                    \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
                    
                    \mathbf{elif}\;F \leq 1550:\\
                    \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, \frac{-x}{\tan B}\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if F < -2500

                      1. Initial program 54.4%

                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in F around -inf

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

                          \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                        2. +-commutativeN/A

                          \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
                        3. distribute-neg-inN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                        4. associate-/l*N/A

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

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                        6. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                        7. lower-neg.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                        8. lower-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                        9. lower-cos.f64N/A

                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                        10. lower-sin.f64N/A

                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                        11. distribute-neg-fracN/A

                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
                        13. lower-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
                        14. lower-sin.f6499.7

                          \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
                      5. Applied rewrites99.7%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\sin B}\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites99.9%

                          \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]

                        if -2500 < F < 1550

                        1. Initial program 99.3%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Add Preprocessing
                        3. Taylor expanded in B around 0

                          \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                        4. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                          2. lower-/.f64N/A

                            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B}} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                          3. lower-sqrt.f64N/A

                            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                          4. lower-/.f64N/A

                            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                          5. associate-+r+N/A

                            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \]
                          6. +-commutativeN/A

                            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \]
                          7. unpow2N/A

                            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \]
                          8. lower-fma.f64N/A

                            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \]
                          9. +-commutativeN/A

                            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \]
                          10. lower-fma.f6484.3

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \]
                        5. Applied rewrites84.3%

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]

                        if 1550 < F

                        1. Initial program 54.7%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Add Preprocessing
                        3. Step-by-step derivation
                          1. lift-+.f64N/A

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                          2. +-commutativeN/A

                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                          3. lift-*.f64N/A

                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          4. lift-/.f64N/A

                            \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          5. div-invN/A

                            \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          6. associate-*l*N/A

                            \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          7. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                        4. Applied rewrites71.3%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
                        5. Step-by-step derivation
                          1. lift-fma.f64N/A

                            \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) + \frac{\mathsf{neg}\left(x\right)}{\tan B}} \]
                          2. lift-*.f64N/A

                            \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right)} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                          3. associate-*r*N/A

                            \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                          4. lift-/.f64N/A

                            \[\leadsto \left(F \cdot \color{blue}{\frac{1}{\sin B}}\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                          5. div-invN/A

                            \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                          6. clear-numN/A

                            \[\leadsto \color{blue}{\frac{1}{\frac{\sin B}{F}}} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                          7. associate-*l/N/A

                            \[\leadsto \color{blue}{\frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                          8. div-invN/A

                            \[\leadsto \frac{1 \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\color{blue}{\sin B \cdot \frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                          9. times-fracN/A

                            \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                          10. lift-/.f64N/A

                            \[\leadsto \color{blue}{\frac{1}{\sin B}} \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}} + \frac{\mathsf{neg}\left(x\right)}{\tan B} \]
                          11. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\frac{1}{F}}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right)} \]
                        6. Applied rewrites71.2%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sin B}, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\frac{1}{F}}, \frac{-x}{\tan B}\right)} \]
                        7. Taylor expanded in F around inf

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                        8. Step-by-step derivation
                          1. Applied rewrites99.6%

                            \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{-x}{\tan B}\right) \]
                        9. Recombined 3 regimes into one program.
                        10. Final simplification92.5%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2500:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1550:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, \frac{-x}{\tan B}\right)\\ \end{array} \]
                        11. Add Preprocessing

                        Alternative 7: 92.3% accurate, 1.6× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2500:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1820:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
                        (FPCore (F B x)
                         :precision binary64
                         (if (<= F -2500.0)
                           (- (/ -1.0 (sin B)) (/ x (tan B)))
                           (if (<= F 1820.0)
                             (+
                              (* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
                              (* (/ -1.0 (tan B)) x))
                             (/ (- 1.0 (* (cos B) x)) (sin B)))))
                        double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -2500.0) {
                        		tmp = (-1.0 / sin(B)) - (x / tan(B));
                        	} else if (F <= 1820.0) {
                        		tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
                        	} else {
                        		tmp = (1.0 - (cos(B) * x)) / sin(B);
                        	}
                        	return tmp;
                        }
                        
                        function code(F, B, x)
                        	tmp = 0.0
                        	if (F <= -2500.0)
                        		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
                        	elseif (F <= 1820.0)
                        		tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x));
                        	else
                        		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
                        	end
                        	return tmp
                        end
                        
                        code[F_, B_, x_] := If[LessEqual[F, -2500.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1820.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;F \leq -2500:\\
                        \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
                        
                        \mathbf{elif}\;F \leq 1820:\\
                        \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if F < -2500

                          1. Initial program 54.4%

                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                          2. Add Preprocessing
                          3. Taylor expanded in F around -inf

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

                              \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                            2. +-commutativeN/A

                              \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
                            3. distribute-neg-inN/A

                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                            4. associate-/l*N/A

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

                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                            6. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                            7. lower-neg.f64N/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                            8. lower-/.f64N/A

                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                            9. lower-cos.f64N/A

                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                            10. lower-sin.f64N/A

                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                            11. distribute-neg-fracN/A

                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
                            12. metadata-evalN/A

                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
                            13. lower-/.f64N/A

                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
                            14. lower-sin.f6499.7

                              \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
                          5. Applied rewrites99.7%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\sin B}\right)} \]
                          6. Step-by-step derivation
                            1. Applied rewrites99.9%

                              \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]

                            if -2500 < F < 1820

                            1. Initial program 99.3%

                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            2. Add Preprocessing
                            3. Taylor expanded in B around 0

                              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                            4. Step-by-step derivation
                              1. lower-*.f64N/A

                                \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                              2. lower-/.f64N/A

                                \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B}} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                              3. lower-sqrt.f64N/A

                                \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                              4. lower-/.f64N/A

                                \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                              5. associate-+r+N/A

                                \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \]
                              6. +-commutativeN/A

                                \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \]
                              7. unpow2N/A

                                \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \]
                              8. lower-fma.f64N/A

                                \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \]
                              9. +-commutativeN/A

                                \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \]
                              10. lower-fma.f6484.3

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \]
                            5. Applied rewrites84.3%

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]

                            if 1820 < F

                            1. Initial program 54.7%

                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            2. Add Preprocessing
                            3. Step-by-step derivation
                              1. lift-+.f64N/A

                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                              2. +-commutativeN/A

                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                              3. lift-*.f64N/A

                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                              4. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                              5. div-invN/A

                                \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                              6. associate-*l*N/A

                                \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                              7. lower-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                            4. Applied rewrites71.3%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
                            5. Applied rewrites71.2%

                              \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}} \]
                            6. Taylor expanded in F around inf

                              \[\leadsto \frac{\color{blue}{1} - \cos B \cdot x}{\sin B} \]
                            7. Step-by-step derivation
                              1. Applied rewrites99.6%

                                \[\leadsto \frac{\color{blue}{1} - \cos B \cdot x}{\sin B} \]
                            8. Recombined 3 regimes into one program.
                            9. Final simplification92.5%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2500:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1820:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
                            10. Add Preprocessing

                            Alternative 8: 92.3% accurate, 1.6× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos B \cdot x\\ \mathbf{if}\;F \leq -2500:\\ \;\;\;\;\frac{-1 - t\_0}{\sin B}\\ \mathbf{elif}\;F \leq 1820:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (let* ((t_0 (* (cos B) x)))
                               (if (<= F -2500.0)
                                 (/ (- -1.0 t_0) (sin B))
                                 (if (<= F 1820.0)
                                   (+
                                    (* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
                                    (* (/ -1.0 (tan B)) x))
                                   (/ (- 1.0 t_0) (sin B))))))
                            double code(double F, double B, double x) {
                            	double t_0 = cos(B) * x;
                            	double tmp;
                            	if (F <= -2500.0) {
                            		tmp = (-1.0 - t_0) / sin(B);
                            	} else if (F <= 1820.0) {
                            		tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
                            	} else {
                            		tmp = (1.0 - t_0) / sin(B);
                            	}
                            	return tmp;
                            }
                            
                            function code(F, B, x)
                            	t_0 = Float64(cos(B) * x)
                            	tmp = 0.0
                            	if (F <= -2500.0)
                            		tmp = Float64(Float64(-1.0 - t_0) / sin(B));
                            	elseif (F <= 1820.0)
                            		tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x));
                            	else
                            		tmp = Float64(Float64(1.0 - t_0) / sin(B));
                            	end
                            	return tmp
                            end
                            
                            code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2500.0], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1820.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := \cos B \cdot x\\
                            \mathbf{if}\;F \leq -2500:\\
                            \;\;\;\;\frac{-1 - t\_0}{\sin B}\\
                            
                            \mathbf{elif}\;F \leq 1820:\\
                            \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{1 - t\_0}{\sin B}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if F < -2500

                              1. Initial program 54.4%

                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                              2. Add Preprocessing
                              3. Taylor expanded in F around -inf

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

                                  \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                                2. +-commutativeN/A

                                  \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
                                3. distribute-neg-inN/A

                                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                4. associate-/l*N/A

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

                                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                6. lower-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                7. lower-neg.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                8. lower-/.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                9. lower-cos.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                10. lower-sin.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                11. distribute-neg-fracN/A

                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
                                12. metadata-evalN/A

                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
                                13. lower-/.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
                                14. lower-sin.f6499.7

                                  \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
                              5. Applied rewrites99.7%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\sin B}\right)} \]
                              6. Step-by-step derivation
                                1. Applied rewrites99.8%

                                  \[\leadsto \frac{-1 - \cos B \cdot x}{\color{blue}{\sin B}} \]

                                if -2500 < F < 1820

                                1. Initial program 99.3%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Add Preprocessing
                                3. Taylor expanded in B around 0

                                  \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                4. Step-by-step derivation
                                  1. lower-*.f64N/A

                                    \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                  2. lower-/.f64N/A

                                    \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B}} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                                  3. lower-sqrt.f64N/A

                                    \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                  4. lower-/.f64N/A

                                    \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                  5. associate-+r+N/A

                                    \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \]
                                  6. +-commutativeN/A

                                    \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \]
                                  7. unpow2N/A

                                    \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \]
                                  8. lower-fma.f64N/A

                                    \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \]
                                  9. +-commutativeN/A

                                    \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \]
                                  10. lower-fma.f6484.3

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \]
                                5. Applied rewrites84.3%

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]

                                if 1820 < F

                                1. Initial program 54.7%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. lift-+.f64N/A

                                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                                  2. +-commutativeN/A

                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                  3. lift-*.f64N/A

                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  4. lift-/.f64N/A

                                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  5. div-invN/A

                                    \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  6. associate-*l*N/A

                                    \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  7. lower-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                4. Applied rewrites71.3%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
                                5. Applied rewrites71.2%

                                  \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}} \]
                                6. Taylor expanded in F around inf

                                  \[\leadsto \frac{\color{blue}{1} - \cos B \cdot x}{\sin B} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites99.6%

                                    \[\leadsto \frac{\color{blue}{1} - \cos B \cdot x}{\sin B} \]
                                8. Recombined 3 regimes into one program.
                                9. Final simplification92.5%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2500:\\ \;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 1820:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
                                10. Add Preprocessing

                                Alternative 9: 83.6% accurate, 1.6× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2500:\\ \;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 5.3 \cdot 10^{-40}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (if (<= F -2500.0)
                                   (/ (- -1.0 (* (cos B) x)) (sin B))
                                   (if (<= F 5.3e-40)
                                     (+
                                      (* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
                                      (* (/ -1.0 (tan B)) x))
                                     (if (<= F 1.35e+154)
                                       (/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
                                       (/ (- 1.0 x) B)))))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= -2500.0) {
                                		tmp = (-1.0 - (cos(B) * x)) / sin(B);
                                	} else if (F <= 5.3e-40) {
                                		tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
                                	} else if (F <= 1.35e+154) {
                                		tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
                                	} else {
                                		tmp = (1.0 - x) / B;
                                	}
                                	return tmp;
                                }
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (F <= -2500.0)
                                		tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B));
                                	elseif (F <= 5.3e-40)
                                		tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x));
                                	elseif (F <= 1.35e+154)
                                		tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B));
                                	else
                                		tmp = Float64(Float64(1.0 - x) / B);
                                	end
                                	return tmp
                                end
                                
                                code[F_, B_, x_] := If[LessEqual[F, -2500.0], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.3e-40], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.35e+154], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;F \leq -2500:\\
                                \;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
                                
                                \mathbf{elif}\;F \leq 5.3 \cdot 10^{-40}:\\
                                \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
                                
                                \mathbf{elif}\;F \leq 1.35 \cdot 10^{+154}:\\
                                \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{1 - x}{B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 4 regimes
                                2. if F < -2500

                                  1. Initial program 54.4%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in F around -inf

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

                                      \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                                    2. +-commutativeN/A

                                      \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
                                    3. distribute-neg-inN/A

                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                    4. associate-/l*N/A

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

                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                    6. lower-fma.f64N/A

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                    7. lower-neg.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                    8. lower-/.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                    9. lower-cos.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                    10. lower-sin.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                    11. distribute-neg-fracN/A

                                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
                                    12. metadata-evalN/A

                                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
                                    13. lower-/.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
                                    14. lower-sin.f6499.7

                                      \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
                                  5. Applied rewrites99.7%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\sin B}\right)} \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites99.8%

                                      \[\leadsto \frac{-1 - \cos B \cdot x}{\color{blue}{\sin B}} \]

                                    if -2500 < F < 5.3000000000000002e-40

                                    1. Initial program 99.3%

                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in B around 0

                                      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                    4. Step-by-step derivation
                                      1. lower-*.f64N/A

                                        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                      2. lower-/.f64N/A

                                        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B}} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                                      3. lower-sqrt.f64N/A

                                        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                      4. lower-/.f64N/A

                                        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                      5. associate-+r+N/A

                                        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \]
                                      6. +-commutativeN/A

                                        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \]
                                      7. unpow2N/A

                                        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \]
                                      8. lower-fma.f64N/A

                                        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \]
                                      9. +-commutativeN/A

                                        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \]
                                      10. lower-fma.f6484.0

                                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \]
                                    5. Applied rewrites84.0%

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]

                                    if 5.3000000000000002e-40 < F < 1.35000000000000003e154

                                    1. Initial program 93.2%

                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    2. Add Preprocessing
                                    3. Step-by-step derivation
                                      1. lift-+.f64N/A

                                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                                      2. +-commutativeN/A

                                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                      3. lift-*.f64N/A

                                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      4. lift-/.f64N/A

                                        \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      5. div-invN/A

                                        \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      6. associate-*l*N/A

                                        \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      7. lower-fma.f64N/A

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                    4. Applied rewrites99.6%

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
                                    5. Applied rewrites99.7%

                                      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}} \]
                                    6. Taylor expanded in B around 0

                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{\sin B} \]
                                    7. Step-by-step derivation
                                      1. sub-negN/A

                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                      2. *-commutativeN/A

                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      3. lower-fma.f64N/A

                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                      4. lower-sqrt.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      5. lower-/.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      6. +-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      7. associate-+l+N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      8. *-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      9. +-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      10. lower-fma.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      11. +-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      12. unpow2N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      13. lower-fma.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                      14. lower-neg.f6491.9

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, \color{blue}{-x}\right)}{\sin B} \]
                                    8. Applied rewrites91.9%

                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}}{\sin B} \]

                                    if 1.35000000000000003e154 < F

                                    1. Initial program 22.9%

                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in B around 0

                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                    4. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                      2. sub-negN/A

                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                      3. *-commutativeN/A

                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                      4. lower-fma.f64N/A

                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                      5. lower-sqrt.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      6. lower-/.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      7. associate-+r+N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      8. +-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      9. unpow2N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      10. lower-fma.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      11. +-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      12. lower-fma.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      13. lower-neg.f6430.7

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                    5. Applied rewrites30.7%

                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                    6. Taylor expanded in F around inf

                                      \[\leadsto \frac{1 - x}{B} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites51.8%

                                        \[\leadsto \frac{1 - x}{B} \]
                                    8. Recombined 4 regimes into one program.
                                    9. Final simplification83.7%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2500:\\ \;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 5.3 \cdot 10^{-40}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                    10. Add Preprocessing

                                    Alternative 10: 77.6% accurate, 1.6× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.15 \cdot 10^{-16}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{-58}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \end{array} \end{array} \]
                                    (FPCore (F B x)
                                     :precision binary64
                                     (if (<= x -3.15e-16)
                                       (/ (* (- x) (cos B)) (sin B))
                                       (if (<= x 7.2e-58)
                                         (/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
                                         (/ (- x) (tan B)))))
                                    double code(double F, double B, double x) {
                                    	double tmp;
                                    	if (x <= -3.15e-16) {
                                    		tmp = (-x * cos(B)) / sin(B);
                                    	} else if (x <= 7.2e-58) {
                                    		tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
                                    	} else {
                                    		tmp = -x / tan(B);
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(F, B, x)
                                    	tmp = 0.0
                                    	if (x <= -3.15e-16)
                                    		tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B));
                                    	elseif (x <= 7.2e-58)
                                    		tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B));
                                    	else
                                    		tmp = Float64(Float64(-x) / tan(B));
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[F_, B_, x_] := If[LessEqual[x, -3.15e-16], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.2e-58], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;x \leq -3.15 \cdot 10^{-16}:\\
                                    \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
                                    
                                    \mathbf{elif}\;x \leq 7.2 \cdot 10^{-58}:\\
                                    \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{-x}{\tan B}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if x < -3.1499999999999999e-16

                                      1. Initial program 52.3%

                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in F around 0

                                        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                      4. Step-by-step derivation
                                        1. mul-1-negN/A

                                          \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                        2. associate-/l*N/A

                                          \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{\cos B}{\sin B}}\right) \]
                                        3. distribute-lft-neg-inN/A

                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
                                        4. lower-*.f64N/A

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

                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{\cos B}{\sin B} \]
                                        6. lower-/.f64N/A

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

                                          \[\leadsto \left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                                        8. lower-sin.f6493.4

                                          \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                                      5. Applied rewrites93.4%

                                        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites93.6%

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

                                        if -3.1499999999999999e-16 < x < 7.20000000000000019e-58

                                        1. Initial program 74.6%

                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        2. Add Preprocessing
                                        3. Step-by-step derivation
                                          1. lift-+.f64N/A

                                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                                          2. +-commutativeN/A

                                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                          3. lift-*.f64N/A

                                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          4. lift-/.f64N/A

                                            \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          5. div-invN/A

                                            \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          6. associate-*l*N/A

                                            \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          7. lower-fma.f64N/A

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                        4. Applied rewrites79.0%

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
                                        5. Applied rewrites79.0%

                                          \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}} \]
                                        6. Taylor expanded in B around 0

                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{\sin B} \]
                                        7. Step-by-step derivation
                                          1. sub-negN/A

                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                          2. *-commutativeN/A

                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          3. lower-fma.f64N/A

                                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                          4. lower-sqrt.f64N/A

                                            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          5. lower-/.f64N/A

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          6. +-commutativeN/A

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          7. associate-+l+N/A

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          8. *-commutativeN/A

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          9. +-commutativeN/A

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          10. lower-fma.f64N/A

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          11. +-commutativeN/A

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          12. unpow2N/A

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          13. lower-fma.f64N/A

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                          14. lower-neg.f6469.6

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, \color{blue}{-x}\right)}{\sin B} \]
                                        8. Applied rewrites69.6%

                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}}{\sin B} \]

                                        if 7.20000000000000019e-58 < x

                                        1. Initial program 85.8%

                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in F around 0

                                          \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                        4. Step-by-step derivation
                                          1. mul-1-negN/A

                                            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                          2. associate-/l*N/A

                                            \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{\cos B}{\sin B}}\right) \]
                                          3. distribute-lft-neg-inN/A

                                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
                                          4. lower-*.f64N/A

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

                                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{\cos B}{\sin B} \]
                                          6. lower-/.f64N/A

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

                                            \[\leadsto \left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                                          8. lower-sin.f6492.0

                                            \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                                        5. Applied rewrites92.0%

                                          \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites92.4%

                                            \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                        7. Recombined 3 regimes into one program.
                                        8. Final simplification80.4%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.15 \cdot 10^{-16}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{-58}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \end{array} \]
                                        9. Add Preprocessing

                                        Alternative 11: 77.6% accurate, 2.2× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;x \leq -3.15 \cdot 10^{-16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{-58}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                        (FPCore (F B x)
                                         :precision binary64
                                         (let* ((t_0 (/ (- x) (tan B))))
                                           (if (<= x -3.15e-16)
                                             t_0
                                             (if (<= x 7.2e-58)
                                               (/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
                                               t_0))))
                                        double code(double F, double B, double x) {
                                        	double t_0 = -x / tan(B);
                                        	double tmp;
                                        	if (x <= -3.15e-16) {
                                        		tmp = t_0;
                                        	} else if (x <= 7.2e-58) {
                                        		tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
                                        	} else {
                                        		tmp = t_0;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(F, B, x)
                                        	t_0 = Float64(Float64(-x) / tan(B))
                                        	tmp = 0.0
                                        	if (x <= -3.15e-16)
                                        		tmp = t_0;
                                        	elseif (x <= 7.2e-58)
                                        		tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B));
                                        	else
                                        		tmp = t_0;
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.15e-16], t$95$0, If[LessEqual[x, 7.2e-58], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        t_0 := \frac{-x}{\tan B}\\
                                        \mathbf{if}\;x \leq -3.15 \cdot 10^{-16}:\\
                                        \;\;\;\;t\_0\\
                                        
                                        \mathbf{elif}\;x \leq 7.2 \cdot 10^{-58}:\\
                                        \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;t\_0\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if x < -3.1499999999999999e-16 or 7.20000000000000019e-58 < x

                                          1. Initial program 76.6%

                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          2. Add Preprocessing
                                          3. Taylor expanded in F around 0

                                            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                          4. Step-by-step derivation
                                            1. mul-1-negN/A

                                              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                            2. associate-/l*N/A

                                              \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{\cos B}{\sin B}}\right) \]
                                            3. distribute-lft-neg-inN/A

                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
                                            4. lower-*.f64N/A

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

                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{\cos B}{\sin B} \]
                                            6. lower-/.f64N/A

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

                                              \[\leadsto \left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                                            8. lower-sin.f6492.4

                                              \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                                          5. Applied rewrites92.4%

                                            \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites92.7%

                                              \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                                            if -3.1499999999999999e-16 < x < 7.20000000000000019e-58

                                            1. Initial program 74.6%

                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            2. Add Preprocessing
                                            3. Step-by-step derivation
                                              1. lift-+.f64N/A

                                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                                              2. +-commutativeN/A

                                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                              3. lift-*.f64N/A

                                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                              4. lift-/.f64N/A

                                                \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                              5. div-invN/A

                                                \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                              6. associate-*l*N/A

                                                \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                              7. lower-fma.f64N/A

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                            4. Applied rewrites79.0%

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
                                            5. Applied rewrites79.0%

                                              \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}} \]
                                            6. Taylor expanded in B around 0

                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{\sin B} \]
                                            7. Step-by-step derivation
                                              1. sub-negN/A

                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                              2. *-commutativeN/A

                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              3. lower-fma.f64N/A

                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                              4. lower-sqrt.f64N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              5. lower-/.f64N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              6. +-commutativeN/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              7. associate-+l+N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              8. *-commutativeN/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              9. +-commutativeN/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              10. lower-fma.f64N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              11. +-commutativeN/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              12. unpow2N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              13. lower-fma.f64N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                              14. lower-neg.f6469.6

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, \color{blue}{-x}\right)}{\sin B} \]
                                            8. Applied rewrites69.6%

                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}}{\sin B} \]
                                          7. Recombined 2 regimes into one program.
                                          8. Add Preprocessing

                                          Alternative 12: 57.7% accurate, 3.1× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 4.4 \cdot 10^{-9}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \end{array} \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (if (<= B 4.4e-9)
                                             (/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B)
                                             (/ (- x) (tan B))))
                                          double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (B <= 4.4e-9) {
                                          		tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
                                          	} else {
                                          		tmp = -x / tan(B);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(F, B, x)
                                          	tmp = 0.0
                                          	if (B <= 4.4e-9)
                                          		tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B);
                                          	else
                                          		tmp = Float64(Float64(-x) / tan(B));
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[F_, B_, x_] := If[LessEqual[B, 4.4e-9], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;B \leq 4.4 \cdot 10^{-9}:\\
                                          \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{-x}{\tan B}\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if B < 4.3999999999999997e-9

                                            1. Initial program 73.2%

                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in B around 0

                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                            4. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                              2. sub-negN/A

                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                              3. *-commutativeN/A

                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                              4. lower-fma.f64N/A

                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                              5. lower-sqrt.f64N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                              6. lower-/.f64N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                              7. associate-+r+N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                              8. +-commutativeN/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                              9. unpow2N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                              10. lower-fma.f64N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                              11. +-commutativeN/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                              12. lower-fma.f64N/A

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                              13. lower-neg.f6465.5

                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                            5. Applied rewrites65.5%

                                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]

                                            if 4.3999999999999997e-9 < B

                                            1. Initial program 82.6%

                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in F around 0

                                              \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                            4. Step-by-step derivation
                                              1. mul-1-negN/A

                                                \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                              2. associate-/l*N/A

                                                \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{\cos B}{\sin B}}\right) \]
                                              3. distribute-lft-neg-inN/A

                                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
                                              4. lower-*.f64N/A

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

                                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{\cos B}{\sin B} \]
                                              6. lower-/.f64N/A

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

                                                \[\leadsto \left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                                              8. lower-sin.f6447.7

                                                \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                                            5. Applied rewrites47.7%

                                              \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites47.9%

                                                \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                            7. Recombined 2 regimes into one program.
                                            8. Add Preprocessing

                                            Alternative 13: 51.8% accurate, 5.7× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1500000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1 - x\right)}{B}\\ \end{array} \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -1.2e+167)
                                               (/
                                                (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
                                                B)
                                               (if (<= F 1500000.0)
                                                 (/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B)
                                                 (/ (fma (/ (fma x 2.0 2.0) (* F F)) -0.5 (- 1.0 x)) B))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.2e+167) {
                                            		tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
                                            	} else if (F <= 1500000.0) {
                                            		tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
                                            	} else {
                                            		tmp = fma((fma(x, 2.0, 2.0) / (F * F)), -0.5, (1.0 - x)) / B;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -1.2e+167)
                                            		tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B);
                                            	elseif (F <= 1500000.0)
                                            		tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B);
                                            	else
                                            		tmp = Float64(fma(Float64(fma(x, 2.0, 2.0) / Float64(F * F)), -0.5, Float64(1.0 - x)) / B);
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -1.2e+167], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1500000.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
                                            
                                            \mathbf{elif}\;F \leq 1500000:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1 - x\right)}{B}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if F < -1.19999999999999999e167

                                              1. Initial program 30.1%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Add Preprocessing
                                              3. Taylor expanded in F around -inf

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

                                                  \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                                                2. +-commutativeN/A

                                                  \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
                                                3. distribute-neg-inN/A

                                                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                                4. associate-/l*N/A

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

                                                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                6. lower-fma.f64N/A

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                                7. lower-neg.f64N/A

                                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                8. lower-/.f64N/A

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                9. lower-cos.f64N/A

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                10. lower-sin.f64N/A

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                11. distribute-neg-fracN/A

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
                                                12. metadata-evalN/A

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
                                                13. lower-/.f64N/A

                                                  \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
                                                14. lower-sin.f6499.8

                                                  \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
                                              5. Applied rewrites99.8%

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

                                                \[\leadsto \frac{\left(-1 \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) - \frac{1}{6}\right)\right) - 1}{\color{blue}{B}} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites69.5%

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

                                                if -1.19999999999999999e167 < F < 1.5e6

                                                1. Initial program 94.9%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in B around 0

                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                4. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  2. sub-negN/A

                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                  3. *-commutativeN/A

                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                  4. lower-fma.f64N/A

                                                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                  5. lower-sqrt.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  6. lower-/.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  7. associate-+r+N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  8. +-commutativeN/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  9. unpow2N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  10. lower-fma.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  11. +-commutativeN/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  12. lower-fma.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  13. lower-neg.f6456.5

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                5. Applied rewrites56.5%

                                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]

                                                if 1.5e6 < F

                                                1. Initial program 54.7%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in B around 0

                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                4. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  2. sub-negN/A

                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                  3. *-commutativeN/A

                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                  4. lower-fma.f64N/A

                                                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                  5. lower-sqrt.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  6. lower-/.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  7. associate-+r+N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  8. +-commutativeN/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  9. unpow2N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  10. lower-fma.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  11. +-commutativeN/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  12. lower-fma.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  13. lower-neg.f6442.6

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                5. Applied rewrites42.6%

                                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                6. Taylor expanded in F around inf

                                                  \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites54.0%

                                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1 - x\right)}{B} \]
                                                8. Recombined 3 regimes into one program.
                                                9. Add Preprocessing

                                                Alternative 14: 44.3% accurate, 5.9× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-29}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1.22 \cdot 10^{-113}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 3700000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                (FPCore (F B x)
                                                 :precision binary64
                                                 (if (<= F -1e-29)
                                                   (/ (fma (* (/ x (* F F)) 2.0) 0.5 (- -1.0 x)) B)
                                                   (if (<= F 1.22e-113)
                                                     (/ (- x) B)
                                                     (if (<= F 3700000.0)
                                                       (/ (* (sqrt (/ 1.0 (fma F F 2.0))) F) B)
                                                       (/ (- 1.0 x) B)))))
                                                double code(double F, double B, double x) {
                                                	double tmp;
                                                	if (F <= -1e-29) {
                                                		tmp = fma(((x / (F * F)) * 2.0), 0.5, (-1.0 - x)) / B;
                                                	} else if (F <= 1.22e-113) {
                                                		tmp = -x / B;
                                                	} else if (F <= 3700000.0) {
                                                		tmp = (sqrt((1.0 / fma(F, F, 2.0))) * F) / B;
                                                	} else {
                                                		tmp = (1.0 - x) / B;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(F, B, x)
                                                	tmp = 0.0
                                                	if (F <= -1e-29)
                                                		tmp = Float64(fma(Float64(Float64(x / Float64(F * F)) * 2.0), 0.5, Float64(-1.0 - x)) / B);
                                                	elseif (F <= 1.22e-113)
                                                		tmp = Float64(Float64(-x) / B);
                                                	elseif (F <= 3700000.0)
                                                		tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * F) / B);
                                                	else
                                                		tmp = Float64(Float64(1.0 - x) / B);
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[F_, B_, x_] := If[LessEqual[F, -1e-29], N[(N[(N[(N[(x / N[(F * F), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * 0.5 + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.22e-113], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 3700000.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;F \leq -1 \cdot 10^{-29}:\\
                                                \;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B}\\
                                                
                                                \mathbf{elif}\;F \leq 1.22 \cdot 10^{-113}:\\
                                                \;\;\;\;\frac{-x}{B}\\
                                                
                                                \mathbf{elif}\;F \leq 3700000:\\
                                                \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{B}\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\frac{1 - x}{B}\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 4 regimes
                                                2. if F < -9.99999999999999943e-30

                                                  1. Initial program 60.3%

                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in B around 0

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  4. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                    2. sub-negN/A

                                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                    3. *-commutativeN/A

                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                    4. lower-fma.f64N/A

                                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                    5. lower-sqrt.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    6. lower-/.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    7. associate-+r+N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    8. +-commutativeN/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    9. unpow2N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    10. lower-fma.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    11. +-commutativeN/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    12. lower-fma.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    13. lower-neg.f6454.7

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                  5. Applied rewrites54.7%

                                                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                  6. Taylor expanded in F around -inf

                                                    \[\leadsto \frac{\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - \left(1 + x\right)}{B} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites59.8%

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, 0.5, -1 - x\right)}{B} \]
                                                    2. Taylor expanded in x around inf

                                                      \[\leadsto \frac{\mathsf{fma}\left(2 \cdot \frac{x}{{F}^{2}}, \frac{1}{2}, -1 - x\right)}{B} \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites60.3%

                                                        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B} \]

                                                      if -9.99999999999999943e-30 < F < 1.21999999999999995e-113

                                                      1. Initial program 99.3%

                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in B around 0

                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                      4. Step-by-step derivation
                                                        1. lower-/.f64N/A

                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                        2. sub-negN/A

                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                        3. *-commutativeN/A

                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        4. lower-fma.f64N/A

                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                        5. lower-sqrt.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        6. lower-/.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        7. associate-+r+N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        8. +-commutativeN/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        9. unpow2N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        10. lower-fma.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        11. +-commutativeN/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        12. lower-fma.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        13. lower-neg.f6450.0

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                      5. Applied rewrites50.0%

                                                        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                      6. Taylor expanded in F around 0

                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites37.7%

                                                          \[\leadsto \frac{-x}{B} \]

                                                        if 1.21999999999999995e-113 < F < 3.7e6

                                                        1. Initial program 99.5%

                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in B around 0

                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                        4. Step-by-step derivation
                                                          1. lower-/.f64N/A

                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                          2. sub-negN/A

                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                          3. *-commutativeN/A

                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                          4. lower-fma.f64N/A

                                                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                          5. lower-sqrt.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          6. lower-/.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          7. associate-+r+N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          8. +-commutativeN/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          9. unpow2N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          10. lower-fma.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          11. +-commutativeN/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          12. lower-fma.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          13. lower-neg.f6468.3

                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                        5. Applied rewrites68.3%

                                                          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                        6. Taylor expanded in x around 0

                                                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites63.3%

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{B} \]

                                                          if 3.7e6 < F

                                                          1. Initial program 54.1%

                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in B around 0

                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                          4. Step-by-step derivation
                                                            1. lower-/.f64N/A

                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                            2. sub-negN/A

                                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                            3. *-commutativeN/A

                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                            4. lower-fma.f64N/A

                                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                            5. lower-sqrt.f64N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            6. lower-/.f64N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            7. associate-+r+N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            8. +-commutativeN/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            9. unpow2N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            10. lower-fma.f64N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            11. +-commutativeN/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            12. lower-fma.f64N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            13. lower-neg.f6443.1

                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                          5. Applied rewrites43.1%

                                                            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                          6. Taylor expanded in F around inf

                                                            \[\leadsto \frac{1 - x}{B} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites54.7%

                                                              \[\leadsto \frac{1 - x}{B} \]
                                                          8. Recombined 4 regimes into one program.
                                                          9. Add Preprocessing

                                                          Alternative 15: 44.3% accurate, 5.9× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-29}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1.22 \cdot 10^{-113}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 3700000:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                          (FPCore (F B x)
                                                           :precision binary64
                                                           (if (<= F -1e-29)
                                                             (/ (fma (* (/ x (* F F)) 2.0) 0.5 (- -1.0 x)) B)
                                                             (if (<= F 1.22e-113)
                                                               (/ (- x) B)
                                                               (if (<= F 3700000.0)
                                                                 (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F B))
                                                                 (/ (- 1.0 x) B)))))
                                                          double code(double F, double B, double x) {
                                                          	double tmp;
                                                          	if (F <= -1e-29) {
                                                          		tmp = fma(((x / (F * F)) * 2.0), 0.5, (-1.0 - x)) / B;
                                                          	} else if (F <= 1.22e-113) {
                                                          		tmp = -x / B;
                                                          	} else if (F <= 3700000.0) {
                                                          		tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / B);
                                                          	} else {
                                                          		tmp = (1.0 - x) / B;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          function code(F, B, x)
                                                          	tmp = 0.0
                                                          	if (F <= -1e-29)
                                                          		tmp = Float64(fma(Float64(Float64(x / Float64(F * F)) * 2.0), 0.5, Float64(-1.0 - x)) / B);
                                                          	elseif (F <= 1.22e-113)
                                                          		tmp = Float64(Float64(-x) / B);
                                                          	elseif (F <= 3700000.0)
                                                          		tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / B));
                                                          	else
                                                          		tmp = Float64(Float64(1.0 - x) / B);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          code[F_, B_, x_] := If[LessEqual[F, -1e-29], N[(N[(N[(N[(x / N[(F * F), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * 0.5 + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.22e-113], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 3700000.0], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;F \leq -1 \cdot 10^{-29}:\\
                                                          \;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B}\\
                                                          
                                                          \mathbf{elif}\;F \leq 1.22 \cdot 10^{-113}:\\
                                                          \;\;\;\;\frac{-x}{B}\\
                                                          
                                                          \mathbf{elif}\;F \leq 3700000:\\
                                                          \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\frac{1 - x}{B}\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 4 regimes
                                                          2. if F < -9.99999999999999943e-30

                                                            1. Initial program 60.3%

                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            2. Add Preprocessing
                                                            3. Taylor expanded in B around 0

                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                            4. Step-by-step derivation
                                                              1. lower-/.f64N/A

                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                              2. sub-negN/A

                                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                              3. *-commutativeN/A

                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                              4. lower-fma.f64N/A

                                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                              5. lower-sqrt.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              6. lower-/.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              7. associate-+r+N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              8. +-commutativeN/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              9. unpow2N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              10. lower-fma.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              11. +-commutativeN/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              12. lower-fma.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              13. lower-neg.f6454.7

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                            5. Applied rewrites54.7%

                                                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                            6. Taylor expanded in F around -inf

                                                              \[\leadsto \frac{\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - \left(1 + x\right)}{B} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites59.8%

                                                                \[\leadsto \frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, 0.5, -1 - x\right)}{B} \]
                                                              2. Taylor expanded in x around inf

                                                                \[\leadsto \frac{\mathsf{fma}\left(2 \cdot \frac{x}{{F}^{2}}, \frac{1}{2}, -1 - x\right)}{B} \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites60.3%

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B} \]

                                                                if -9.99999999999999943e-30 < F < 1.21999999999999995e-113

                                                                1. Initial program 99.3%

                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                2. Add Preprocessing
                                                                3. Taylor expanded in B around 0

                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                4. Step-by-step derivation
                                                                  1. lower-/.f64N/A

                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                  2. sub-negN/A

                                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                  3. *-commutativeN/A

                                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  4. lower-fma.f64N/A

                                                                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                  5. lower-sqrt.f64N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  6. lower-/.f64N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  7. associate-+r+N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  8. +-commutativeN/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  9. unpow2N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  10. lower-fma.f64N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  11. +-commutativeN/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  12. lower-fma.f64N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  13. lower-neg.f6450.0

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                5. Applied rewrites50.0%

                                                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                6. Taylor expanded in F around 0

                                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites37.7%

                                                                    \[\leadsto \frac{-x}{B} \]

                                                                  if 1.21999999999999995e-113 < F < 3.7e6

                                                                  1. Initial program 99.5%

                                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in B around 0

                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                  4. Step-by-step derivation
                                                                    1. lower-/.f64N/A

                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                    2. sub-negN/A

                                                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                    3. *-commutativeN/A

                                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    4. lower-fma.f64N/A

                                                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                    5. lower-sqrt.f64N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    6. lower-/.f64N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    7. associate-+r+N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    8. +-commutativeN/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    9. unpow2N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    10. lower-fma.f64N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    11. +-commutativeN/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    12. lower-fma.f64N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    13. lower-neg.f6468.3

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                  5. Applied rewrites68.3%

                                                                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                  6. Taylor expanded in x around 0

                                                                    \[\leadsto \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites63.1%

                                                                      \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \color{blue}{\frac{F}{B}} \]

                                                                    if 3.7e6 < F

                                                                    1. Initial program 54.1%

                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                    2. Add Preprocessing
                                                                    3. Taylor expanded in B around 0

                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                    4. Step-by-step derivation
                                                                      1. lower-/.f64N/A

                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                      2. sub-negN/A

                                                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                      3. *-commutativeN/A

                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      4. lower-fma.f64N/A

                                                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                      5. lower-sqrt.f64N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      6. lower-/.f64N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      7. associate-+r+N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      8. +-commutativeN/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      9. unpow2N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      10. lower-fma.f64N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      11. +-commutativeN/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      12. lower-fma.f64N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      13. lower-neg.f6443.1

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                    5. Applied rewrites43.1%

                                                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                    6. Taylor expanded in F around inf

                                                                      \[\leadsto \frac{1 - x}{B} \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites54.7%

                                                                        \[\leadsto \frac{1 - x}{B} \]
                                                                    8. Recombined 4 regimes into one program.
                                                                    9. Add Preprocessing

                                                                    Alternative 16: 51.9% accurate, 6.1× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1000000:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1 - x\right)}{B}\\ \end{array} \end{array} \]
                                                                    (FPCore (F B x)
                                                                     :precision binary64
                                                                     (if (<= F -1.2e+167)
                                                                       (/
                                                                        (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
                                                                        B)
                                                                       (if (<= F 1000000.0)
                                                                         (/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
                                                                         (/ (fma (/ (fma x 2.0 2.0) (* F F)) -0.5 (- 1.0 x)) B))))
                                                                    double code(double F, double B, double x) {
                                                                    	double tmp;
                                                                    	if (F <= -1.2e+167) {
                                                                    		tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
                                                                    	} else if (F <= 1000000.0) {
                                                                    		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
                                                                    	} else {
                                                                    		tmp = fma((fma(x, 2.0, 2.0) / (F * F)), -0.5, (1.0 - x)) / B;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    function code(F, B, x)
                                                                    	tmp = 0.0
                                                                    	if (F <= -1.2e+167)
                                                                    		tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B);
                                                                    	elseif (F <= 1000000.0)
                                                                    		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B);
                                                                    	else
                                                                    		tmp = Float64(fma(Float64(fma(x, 2.0, 2.0) / Float64(F * F)), -0.5, Float64(1.0 - x)) / B);
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    code[F_, B_, x_] := If[LessEqual[F, -1.2e+167], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1000000.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    \mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\
                                                                    \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
                                                                    
                                                                    \mathbf{elif}\;F \leq 1000000:\\
                                                                    \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1 - x\right)}{B}\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 3 regimes
                                                                    2. if F < -1.19999999999999999e167

                                                                      1. Initial program 30.1%

                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                      2. Add Preprocessing
                                                                      3. Taylor expanded in F around -inf

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

                                                                          \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                                                                        2. +-commutativeN/A

                                                                          \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
                                                                        3. distribute-neg-inN/A

                                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                                                        4. associate-/l*N/A

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

                                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                        6. lower-fma.f64N/A

                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                                                        7. lower-neg.f64N/A

                                                                          \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                        8. lower-/.f64N/A

                                                                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                        9. lower-cos.f64N/A

                                                                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                        10. lower-sin.f64N/A

                                                                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                        11. distribute-neg-fracN/A

                                                                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
                                                                        12. metadata-evalN/A

                                                                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
                                                                        13. lower-/.f64N/A

                                                                          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
                                                                        14. lower-sin.f6499.8

                                                                          \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
                                                                      5. Applied rewrites99.8%

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

                                                                        \[\leadsto \frac{\left(-1 \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) - \frac{1}{6}\right)\right) - 1}{\color{blue}{B}} \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites69.5%

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

                                                                        if -1.19999999999999999e167 < F < 1e6

                                                                        1. Initial program 94.9%

                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in B around 0

                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                        4. Step-by-step derivation
                                                                          1. lower-/.f64N/A

                                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                          2. sub-negN/A

                                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                          3. *-commutativeN/A

                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          4. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                          5. lower-sqrt.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          6. lower-/.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          7. associate-+r+N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          8. +-commutativeN/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          9. unpow2N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          10. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          11. +-commutativeN/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          12. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          13. lower-neg.f6456.5

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                        5. Applied rewrites56.5%

                                                                          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                        6. Applied rewrites56.5%

                                                                          \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}} \]

                                                                        if 1e6 < F

                                                                        1. Initial program 54.7%

                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in B around 0

                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                        4. Step-by-step derivation
                                                                          1. lower-/.f64N/A

                                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                          2. sub-negN/A

                                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                          3. *-commutativeN/A

                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          4. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                          5. lower-sqrt.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          6. lower-/.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          7. associate-+r+N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          8. +-commutativeN/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          9. unpow2N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          10. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          11. +-commutativeN/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          12. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          13. lower-neg.f6442.6

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                        5. Applied rewrites42.6%

                                                                          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                        6. Taylor expanded in F around inf

                                                                          \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites54.0%

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1 - x\right)}{B} \]
                                                                        8. Recombined 3 regimes into one program.
                                                                        9. Add Preprocessing

                                                                        Alternative 17: 51.8% accurate, 6.2× speedup?

                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 150000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                        (FPCore (F B x)
                                                                         :precision binary64
                                                                         (if (<= F -1.2e+167)
                                                                           (/
                                                                            (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
                                                                            B)
                                                                           (if (<= F 150000000.0)
                                                                             (/ (fma (sqrt (/ 1.0 (fma F F 2.0))) F (- x)) B)
                                                                             (/ (- 1.0 x) B))))
                                                                        double code(double F, double B, double x) {
                                                                        	double tmp;
                                                                        	if (F <= -1.2e+167) {
                                                                        		tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
                                                                        	} else if (F <= 150000000.0) {
                                                                        		tmp = fma(sqrt((1.0 / fma(F, F, 2.0))), F, -x) / B;
                                                                        	} else {
                                                                        		tmp = (1.0 - x) / B;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        function code(F, B, x)
                                                                        	tmp = 0.0
                                                                        	if (F <= -1.2e+167)
                                                                        		tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B);
                                                                        	elseif (F <= 150000000.0)
                                                                        		tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, 2.0))), F, Float64(-x)) / B);
                                                                        	else
                                                                        		tmp = Float64(Float64(1.0 - x) / B);
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        code[F_, B_, x_] := If[LessEqual[F, -1.2e+167], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 150000000.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                        
                                                                        \begin{array}{l}
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        \mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\
                                                                        \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
                                                                        
                                                                        \mathbf{elif}\;F \leq 150000000:\\
                                                                        \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, F, -x\right)}{B}\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;\frac{1 - x}{B}\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 3 regimes
                                                                        2. if F < -1.19999999999999999e167

                                                                          1. Initial program 30.1%

                                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                          2. Add Preprocessing
                                                                          3. Taylor expanded in F around -inf

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

                                                                              \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                                                                            2. +-commutativeN/A

                                                                              \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
                                                                            3. distribute-neg-inN/A

                                                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                                                            4. associate-/l*N/A

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

                                                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                            6. lower-fma.f64N/A

                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                                                            7. lower-neg.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                            8. lower-/.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                            9. lower-cos.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                            10. lower-sin.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                            11. distribute-neg-fracN/A

                                                                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
                                                                            12. metadata-evalN/A

                                                                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
                                                                            13. lower-/.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
                                                                            14. lower-sin.f6499.8

                                                                              \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
                                                                          5. Applied rewrites99.8%

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

                                                                            \[\leadsto \frac{\left(-1 \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) - \frac{1}{6}\right)\right) - 1}{\color{blue}{B}} \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites69.5%

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

                                                                            if -1.19999999999999999e167 < F < 1.5e8

                                                                            1. Initial program 94.9%

                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in B around 0

                                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                            4. Step-by-step derivation
                                                                              1. lower-/.f64N/A

                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                              2. sub-negN/A

                                                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                              3. *-commutativeN/A

                                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              4. lower-fma.f64N/A

                                                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                              5. lower-sqrt.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              6. lower-/.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              7. associate-+r+N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              8. +-commutativeN/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              9. unpow2N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              10. lower-fma.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              11. +-commutativeN/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              12. lower-fma.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              13. lower-neg.f6456.1

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                            5. Applied rewrites56.1%

                                                                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                            6. Taylor expanded in x around 0

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 + {F}^{2}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            7. Step-by-step derivation
                                                                              1. Applied rewrites55.8%

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, F, -x\right)}{B} \]

                                                                              if 1.5e8 < F

                                                                              1. Initial program 54.1%

                                                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                              2. Add Preprocessing
                                                                              3. Taylor expanded in B around 0

                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                              4. Step-by-step derivation
                                                                                1. lower-/.f64N/A

                                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                2. sub-negN/A

                                                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                3. *-commutativeN/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                4. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                5. lower-sqrt.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                6. lower-/.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                7. associate-+r+N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                8. +-commutativeN/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                9. unpow2N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                10. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                11. +-commutativeN/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                12. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                13. lower-neg.f6443.1

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                              5. Applied rewrites43.1%

                                                                                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                              6. Taylor expanded in F around inf

                                                                                \[\leadsto \frac{1 - x}{B} \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites54.7%

                                                                                  \[\leadsto \frac{1 - x}{B} \]
                                                                              8. Recombined 3 regimes into one program.
                                                                              9. Add Preprocessing

                                                                              Alternative 18: 43.9% accurate, 7.7× speedup?

                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-29}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-117}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                              (FPCore (F B x)
                                                                               :precision binary64
                                                                               (if (<= F -1e-29)
                                                                                 (/ (fma (* (/ x (* F F)) 2.0) 0.5 (- -1.0 x)) B)
                                                                                 (if (<= F 1.9e-117) (/ (- x) B) (/ (- 1.0 x) B))))
                                                                              double code(double F, double B, double x) {
                                                                              	double tmp;
                                                                              	if (F <= -1e-29) {
                                                                              		tmp = fma(((x / (F * F)) * 2.0), 0.5, (-1.0 - x)) / B;
                                                                              	} else if (F <= 1.9e-117) {
                                                                              		tmp = -x / B;
                                                                              	} else {
                                                                              		tmp = (1.0 - x) / B;
                                                                              	}
                                                                              	return tmp;
                                                                              }
                                                                              
                                                                              function code(F, B, x)
                                                                              	tmp = 0.0
                                                                              	if (F <= -1e-29)
                                                                              		tmp = Float64(fma(Float64(Float64(x / Float64(F * F)) * 2.0), 0.5, Float64(-1.0 - x)) / B);
                                                                              	elseif (F <= 1.9e-117)
                                                                              		tmp = Float64(Float64(-x) / B);
                                                                              	else
                                                                              		tmp = Float64(Float64(1.0 - x) / B);
                                                                              	end
                                                                              	return tmp
                                                                              end
                                                                              
                                                                              code[F_, B_, x_] := If[LessEqual[F, -1e-29], N[(N[(N[(N[(x / N[(F * F), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * 0.5 + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.9e-117], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                              
                                                                              \begin{array}{l}
                                                                              
                                                                              \\
                                                                              \begin{array}{l}
                                                                              \mathbf{if}\;F \leq -1 \cdot 10^{-29}:\\
                                                                              \;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B}\\
                                                                              
                                                                              \mathbf{elif}\;F \leq 1.9 \cdot 10^{-117}:\\
                                                                              \;\;\;\;\frac{-x}{B}\\
                                                                              
                                                                              \mathbf{else}:\\
                                                                              \;\;\;\;\frac{1 - x}{B}\\
                                                                              
                                                                              
                                                                              \end{array}
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Split input into 3 regimes
                                                                              2. if F < -9.99999999999999943e-30

                                                                                1. Initial program 60.3%

                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                2. Add Preprocessing
                                                                                3. Taylor expanded in B around 0

                                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                4. Step-by-step derivation
                                                                                  1. lower-/.f64N/A

                                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                  2. sub-negN/A

                                                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                  3. *-commutativeN/A

                                                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  4. lower-fma.f64N/A

                                                                                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                  5. lower-sqrt.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  6. lower-/.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  7. associate-+r+N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  8. +-commutativeN/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  9. unpow2N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  10. lower-fma.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  11. +-commutativeN/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  12. lower-fma.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  13. lower-neg.f6454.7

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                5. Applied rewrites54.7%

                                                                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                6. Taylor expanded in F around -inf

                                                                                  \[\leadsto \frac{\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - \left(1 + x\right)}{B} \]
                                                                                7. Step-by-step derivation
                                                                                  1. Applied rewrites59.8%

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, 0.5, -1 - x\right)}{B} \]
                                                                                  2. Taylor expanded in x around inf

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(2 \cdot \frac{x}{{F}^{2}}, \frac{1}{2}, -1 - x\right)}{B} \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites60.3%

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B} \]

                                                                                    if -9.99999999999999943e-30 < F < 1.89999999999999986e-117

                                                                                    1. Initial program 99.3%

                                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                    2. Add Preprocessing
                                                                                    3. Taylor expanded in B around 0

                                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                    4. Step-by-step derivation
                                                                                      1. lower-/.f64N/A

                                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                      2. sub-negN/A

                                                                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                      3. *-commutativeN/A

                                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      4. lower-fma.f64N/A

                                                                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                      5. lower-sqrt.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      6. lower-/.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      7. associate-+r+N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      8. +-commutativeN/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      9. unpow2N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      10. lower-fma.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      11. +-commutativeN/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      12. lower-fma.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      13. lower-neg.f6449.4

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                    5. Applied rewrites49.4%

                                                                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                    6. Taylor expanded in F around 0

                                                                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                    7. Step-by-step derivation
                                                                                      1. Applied rewrites37.0%

                                                                                        \[\leadsto \frac{-x}{B} \]

                                                                                      if 1.89999999999999986e-117 < F

                                                                                      1. Initial program 65.2%

                                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in B around 0

                                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. lower-/.f64N/A

                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                        2. sub-negN/A

                                                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                        3. *-commutativeN/A

                                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        4. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                        5. lower-sqrt.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        6. lower-/.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        7. associate-+r+N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        8. +-commutativeN/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        9. unpow2N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        10. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        11. +-commutativeN/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        12. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        13. lower-neg.f6449.6

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                      5. Applied rewrites49.6%

                                                                                        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                      6. Taylor expanded in F around inf

                                                                                        \[\leadsto \frac{1 - x}{B} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites45.0%

                                                                                          \[\leadsto \frac{1 - x}{B} \]
                                                                                      8. Recombined 3 regimes into one program.
                                                                                      9. Add Preprocessing

                                                                                      Alternative 19: 44.4% accurate, 9.7× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9.6 \cdot 10^{-37}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-117}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                                      (FPCore (F B x)
                                                                                       :precision binary64
                                                                                       (if (<= F -9.6e-37)
                                                                                         (/
                                                                                          (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
                                                                                          B)
                                                                                         (if (<= F 1.9e-117) (/ (- x) B) (/ (- 1.0 x) B))))
                                                                                      double code(double F, double B, double x) {
                                                                                      	double tmp;
                                                                                      	if (F <= -9.6e-37) {
                                                                                      		tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
                                                                                      	} else if (F <= 1.9e-117) {
                                                                                      		tmp = -x / B;
                                                                                      	} else {
                                                                                      		tmp = (1.0 - x) / B;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      function code(F, B, x)
                                                                                      	tmp = 0.0
                                                                                      	if (F <= -9.6e-37)
                                                                                      		tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B);
                                                                                      	elseif (F <= 1.9e-117)
                                                                                      		tmp = Float64(Float64(-x) / B);
                                                                                      	else
                                                                                      		tmp = Float64(Float64(1.0 - x) / B);
                                                                                      	end
                                                                                      	return tmp
                                                                                      end
                                                                                      
                                                                                      code[F_, B_, x_] := If[LessEqual[F, -9.6e-37], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.9e-117], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      \mathbf{if}\;F \leq -9.6 \cdot 10^{-37}:\\
                                                                                      \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
                                                                                      
                                                                                      \mathbf{elif}\;F \leq 1.9 \cdot 10^{-117}:\\
                                                                                      \;\;\;\;\frac{-x}{B}\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;\frac{1 - x}{B}\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 3 regimes
                                                                                      2. if F < -9.59999999999999963e-37

                                                                                        1. Initial program 62.0%

                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                        2. Add Preprocessing
                                                                                        3. Taylor expanded in F around -inf

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

                                                                                            \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                                                                                          2. +-commutativeN/A

                                                                                            \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)}\right) \]
                                                                                          3. distribute-neg-inN/A

                                                                                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                                                                          4. associate-/l*N/A

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

                                                                                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} + \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                                          6. lower-fma.f64N/A

                                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right)} \]
                                                                                          7. lower-neg.f64N/A

                                                                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{\cos B}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                                          8. lower-/.f64N/A

                                                                                            \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \color{blue}{\frac{\cos B}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                                          9. lower-cos.f64N/A

                                                                                            \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\color{blue}{\cos B}}{\sin B}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                                          10. lower-sin.f64N/A

                                                                                            \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\color{blue}{\sin B}}, \mathsf{neg}\left(\frac{1}{\sin B}\right)\right) \]
                                                                                          11. distribute-neg-fracN/A

                                                                                            \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\sin B}}\right) \]
                                                                                          12. metadata-evalN/A

                                                                                            \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \frac{\color{blue}{-1}}{\sin B}\right) \]
                                                                                          13. lower-/.f64N/A

                                                                                            \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\cos B}{\sin B}, \color{blue}{\frac{-1}{\sin B}}\right) \]
                                                                                          14. lower-sin.f6490.0

                                                                                            \[\leadsto \mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\color{blue}{\sin B}}\right) \]
                                                                                        5. Applied rewrites90.0%

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

                                                                                          \[\leadsto \frac{\left(-1 \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) - \frac{1}{6}\right)\right) - 1}{\color{blue}{B}} \]
                                                                                        7. Step-by-step derivation
                                                                                          1. Applied rewrites59.1%

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

                                                                                          if -9.59999999999999963e-37 < F < 1.89999999999999986e-117

                                                                                          1. Initial program 99.3%

                                                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                          2. Add Preprocessing
                                                                                          3. Taylor expanded in B around 0

                                                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                          4. Step-by-step derivation
                                                                                            1. lower-/.f64N/A

                                                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                            2. sub-negN/A

                                                                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                            3. *-commutativeN/A

                                                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            4. lower-fma.f64N/A

                                                                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                            5. lower-sqrt.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            6. lower-/.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            7. associate-+r+N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            8. +-commutativeN/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            9. unpow2N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            10. lower-fma.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            11. +-commutativeN/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            12. lower-fma.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            13. lower-neg.f6448.8

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                          5. Applied rewrites48.8%

                                                                                            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                          6. Taylor expanded in F around 0

                                                                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                          7. Step-by-step derivation
                                                                                            1. Applied rewrites37.0%

                                                                                              \[\leadsto \frac{-x}{B} \]

                                                                                            if 1.89999999999999986e-117 < F

                                                                                            1. Initial program 65.2%

                                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                            2. Add Preprocessing
                                                                                            3. Taylor expanded in B around 0

                                                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                            4. Step-by-step derivation
                                                                                              1. lower-/.f64N/A

                                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                              2. sub-negN/A

                                                                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                              3. *-commutativeN/A

                                                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                              4. lower-fma.f64N/A

                                                                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                              5. lower-sqrt.f64N/A

                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                              6. lower-/.f64N/A

                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                              7. associate-+r+N/A

                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                              8. +-commutativeN/A

                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                              9. unpow2N/A

                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                              10. lower-fma.f64N/A

                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                              11. +-commutativeN/A

                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                              12. lower-fma.f64N/A

                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                              13. lower-neg.f6449.6

                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                            5. Applied rewrites49.6%

                                                                                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                            6. Taylor expanded in F around inf

                                                                                              \[\leadsto \frac{1 - x}{B} \]
                                                                                            7. Step-by-step derivation
                                                                                              1. Applied rewrites45.0%

                                                                                                \[\leadsto \frac{1 - x}{B} \]
                                                                                            8. Recombined 3 regimes into one program.
                                                                                            9. Add Preprocessing

                                                                                            Alternative 20: 44.3% accurate, 13.6× speedup?

                                                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9.6 \cdot 10^{-37}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-117}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                                            (FPCore (F B x)
                                                                                             :precision binary64
                                                                                             (if (<= F -9.6e-37)
                                                                                               (/ (- -1.0 x) B)
                                                                                               (if (<= F 1.9e-117) (/ (- x) B) (/ (- 1.0 x) B))))
                                                                                            double code(double F, double B, double x) {
                                                                                            	double tmp;
                                                                                            	if (F <= -9.6e-37) {
                                                                                            		tmp = (-1.0 - x) / B;
                                                                                            	} else if (F <= 1.9e-117) {
                                                                                            		tmp = -x / B;
                                                                                            	} else {
                                                                                            		tmp = (1.0 - x) / B;
                                                                                            	}
                                                                                            	return tmp;
                                                                                            }
                                                                                            
                                                                                            real(8) function code(f, b, x)
                                                                                                real(8), intent (in) :: f
                                                                                                real(8), intent (in) :: b
                                                                                                real(8), intent (in) :: x
                                                                                                real(8) :: tmp
                                                                                                if (f <= (-9.6d-37)) then
                                                                                                    tmp = ((-1.0d0) - x) / b
                                                                                                else if (f <= 1.9d-117) then
                                                                                                    tmp = -x / b
                                                                                                else
                                                                                                    tmp = (1.0d0 - x) / b
                                                                                                end if
                                                                                                code = tmp
                                                                                            end function
                                                                                            
                                                                                            public static double code(double F, double B, double x) {
                                                                                            	double tmp;
                                                                                            	if (F <= -9.6e-37) {
                                                                                            		tmp = (-1.0 - x) / B;
                                                                                            	} else if (F <= 1.9e-117) {
                                                                                            		tmp = -x / B;
                                                                                            	} else {
                                                                                            		tmp = (1.0 - x) / B;
                                                                                            	}
                                                                                            	return tmp;
                                                                                            }
                                                                                            
                                                                                            def code(F, B, x):
                                                                                            	tmp = 0
                                                                                            	if F <= -9.6e-37:
                                                                                            		tmp = (-1.0 - x) / B
                                                                                            	elif F <= 1.9e-117:
                                                                                            		tmp = -x / B
                                                                                            	else:
                                                                                            		tmp = (1.0 - x) / B
                                                                                            	return tmp
                                                                                            
                                                                                            function code(F, B, x)
                                                                                            	tmp = 0.0
                                                                                            	if (F <= -9.6e-37)
                                                                                            		tmp = Float64(Float64(-1.0 - x) / B);
                                                                                            	elseif (F <= 1.9e-117)
                                                                                            		tmp = Float64(Float64(-x) / B);
                                                                                            	else
                                                                                            		tmp = Float64(Float64(1.0 - x) / B);
                                                                                            	end
                                                                                            	return tmp
                                                                                            end
                                                                                            
                                                                                            function tmp_2 = code(F, B, x)
                                                                                            	tmp = 0.0;
                                                                                            	if (F <= -9.6e-37)
                                                                                            		tmp = (-1.0 - x) / B;
                                                                                            	elseif (F <= 1.9e-117)
                                                                                            		tmp = -x / B;
                                                                                            	else
                                                                                            		tmp = (1.0 - x) / B;
                                                                                            	end
                                                                                            	tmp_2 = tmp;
                                                                                            end
                                                                                            
                                                                                            code[F_, B_, x_] := If[LessEqual[F, -9.6e-37], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.9e-117], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                                            
                                                                                            \begin{array}{l}
                                                                                            
                                                                                            \\
                                                                                            \begin{array}{l}
                                                                                            \mathbf{if}\;F \leq -9.6 \cdot 10^{-37}:\\
                                                                                            \;\;\;\;\frac{-1 - x}{B}\\
                                                                                            
                                                                                            \mathbf{elif}\;F \leq 1.9 \cdot 10^{-117}:\\
                                                                                            \;\;\;\;\frac{-x}{B}\\
                                                                                            
                                                                                            \mathbf{else}:\\
                                                                                            \;\;\;\;\frac{1 - x}{B}\\
                                                                                            
                                                                                            
                                                                                            \end{array}
                                                                                            \end{array}
                                                                                            
                                                                                            Derivation
                                                                                            1. Split input into 3 regimes
                                                                                            2. if F < -9.59999999999999963e-37

                                                                                              1. Initial program 62.0%

                                                                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                              2. Add Preprocessing
                                                                                              3. Taylor expanded in B around 0

                                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                              4. Step-by-step derivation
                                                                                                1. lower-/.f64N/A

                                                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                2. sub-negN/A

                                                                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                3. *-commutativeN/A

                                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                4. lower-fma.f64N/A

                                                                                                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                5. lower-sqrt.f64N/A

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                6. lower-/.f64N/A

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                7. associate-+r+N/A

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                8. +-commutativeN/A

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                9. unpow2N/A

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                10. lower-fma.f64N/A

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                11. +-commutativeN/A

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                12. lower-fma.f64N/A

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                13. lower-neg.f6455.2

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                              5. Applied rewrites55.2%

                                                                                                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                              6. Taylor expanded in F around -inf

                                                                                                \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                                                              7. Step-by-step derivation
                                                                                                1. Applied rewrites59.0%

                                                                                                  \[\leadsto \frac{-1 - x}{B} \]

                                                                                                if -9.59999999999999963e-37 < F < 1.89999999999999986e-117

                                                                                                1. Initial program 99.3%

                                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                2. Add Preprocessing
                                                                                                3. Taylor expanded in B around 0

                                                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. lower-/.f64N/A

                                                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                  2. sub-negN/A

                                                                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                  3. *-commutativeN/A

                                                                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                  4. lower-fma.f64N/A

                                                                                                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                  5. lower-sqrt.f64N/A

                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                  6. lower-/.f64N/A

                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                  7. associate-+r+N/A

                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                  8. +-commutativeN/A

                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                  9. unpow2N/A

                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                  10. lower-fma.f64N/A

                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                  11. +-commutativeN/A

                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                  12. lower-fma.f64N/A

                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                  13. lower-neg.f6448.8

                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                                5. Applied rewrites48.8%

                                                                                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                                6. Taylor expanded in F around 0

                                                                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                7. Step-by-step derivation
                                                                                                  1. Applied rewrites37.0%

                                                                                                    \[\leadsto \frac{-x}{B} \]

                                                                                                  if 1.89999999999999986e-117 < F

                                                                                                  1. Initial program 65.2%

                                                                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                  2. Add Preprocessing
                                                                                                  3. Taylor expanded in B around 0

                                                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                  4. Step-by-step derivation
                                                                                                    1. lower-/.f64N/A

                                                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                    2. sub-negN/A

                                                                                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                    3. *-commutativeN/A

                                                                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                    4. lower-fma.f64N/A

                                                                                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                    5. lower-sqrt.f64N/A

                                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                    6. lower-/.f64N/A

                                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                    7. associate-+r+N/A

                                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                    8. +-commutativeN/A

                                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                    9. unpow2N/A

                                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                    10. lower-fma.f64N/A

                                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                    11. +-commutativeN/A

                                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                    12. lower-fma.f64N/A

                                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                    13. lower-neg.f6449.6

                                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                                  5. Applied rewrites49.6%

                                                                                                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                                  6. Taylor expanded in F around inf

                                                                                                    \[\leadsto \frac{1 - x}{B} \]
                                                                                                  7. Step-by-step derivation
                                                                                                    1. Applied rewrites45.0%

                                                                                                      \[\leadsto \frac{1 - x}{B} \]
                                                                                                  8. Recombined 3 regimes into one program.
                                                                                                  9. Add Preprocessing

                                                                                                  Alternative 21: 36.8% accurate, 17.5× speedup?

                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9.6 \cdot 10^{-37}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                                                                  (FPCore (F B x)
                                                                                                   :precision binary64
                                                                                                   (if (<= F -9.6e-37) (/ (- -1.0 x) B) (/ (- x) B)))
                                                                                                  double code(double F, double B, double x) {
                                                                                                  	double tmp;
                                                                                                  	if (F <= -9.6e-37) {
                                                                                                  		tmp = (-1.0 - x) / B;
                                                                                                  	} else {
                                                                                                  		tmp = -x / B;
                                                                                                  	}
                                                                                                  	return tmp;
                                                                                                  }
                                                                                                  
                                                                                                  real(8) function code(f, b, x)
                                                                                                      real(8), intent (in) :: f
                                                                                                      real(8), intent (in) :: b
                                                                                                      real(8), intent (in) :: x
                                                                                                      real(8) :: tmp
                                                                                                      if (f <= (-9.6d-37)) then
                                                                                                          tmp = ((-1.0d0) - x) / b
                                                                                                      else
                                                                                                          tmp = -x / b
                                                                                                      end if
                                                                                                      code = tmp
                                                                                                  end function
                                                                                                  
                                                                                                  public static double code(double F, double B, double x) {
                                                                                                  	double tmp;
                                                                                                  	if (F <= -9.6e-37) {
                                                                                                  		tmp = (-1.0 - x) / B;
                                                                                                  	} else {
                                                                                                  		tmp = -x / B;
                                                                                                  	}
                                                                                                  	return tmp;
                                                                                                  }
                                                                                                  
                                                                                                  def code(F, B, x):
                                                                                                  	tmp = 0
                                                                                                  	if F <= -9.6e-37:
                                                                                                  		tmp = (-1.0 - x) / B
                                                                                                  	else:
                                                                                                  		tmp = -x / B
                                                                                                  	return tmp
                                                                                                  
                                                                                                  function code(F, B, x)
                                                                                                  	tmp = 0.0
                                                                                                  	if (F <= -9.6e-37)
                                                                                                  		tmp = Float64(Float64(-1.0 - x) / B);
                                                                                                  	else
                                                                                                  		tmp = Float64(Float64(-x) / B);
                                                                                                  	end
                                                                                                  	return tmp
                                                                                                  end
                                                                                                  
                                                                                                  function tmp_2 = code(F, B, x)
                                                                                                  	tmp = 0.0;
                                                                                                  	if (F <= -9.6e-37)
                                                                                                  		tmp = (-1.0 - x) / B;
                                                                                                  	else
                                                                                                  		tmp = -x / B;
                                                                                                  	end
                                                                                                  	tmp_2 = tmp;
                                                                                                  end
                                                                                                  
                                                                                                  code[F_, B_, x_] := If[LessEqual[F, -9.6e-37], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                                                                  
                                                                                                  \begin{array}{l}
                                                                                                  
                                                                                                  \\
                                                                                                  \begin{array}{l}
                                                                                                  \mathbf{if}\;F \leq -9.6 \cdot 10^{-37}:\\
                                                                                                  \;\;\;\;\frac{-1 - x}{B}\\
                                                                                                  
                                                                                                  \mathbf{else}:\\
                                                                                                  \;\;\;\;\frac{-x}{B}\\
                                                                                                  
                                                                                                  
                                                                                                  \end{array}
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Split input into 2 regimes
                                                                                                  2. if F < -9.59999999999999963e-37

                                                                                                    1. Initial program 62.0%

                                                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                    2. Add Preprocessing
                                                                                                    3. Taylor expanded in B around 0

                                                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                    4. Step-by-step derivation
                                                                                                      1. lower-/.f64N/A

                                                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                      2. sub-negN/A

                                                                                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                      3. *-commutativeN/A

                                                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                      4. lower-fma.f64N/A

                                                                                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                      5. lower-sqrt.f64N/A

                                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                      6. lower-/.f64N/A

                                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                      7. associate-+r+N/A

                                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                      8. +-commutativeN/A

                                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                      9. unpow2N/A

                                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                      10. lower-fma.f64N/A

                                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                      11. +-commutativeN/A

                                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                      12. lower-fma.f64N/A

                                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                      13. lower-neg.f6455.2

                                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                                    5. Applied rewrites55.2%

                                                                                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                                    6. Taylor expanded in F around -inf

                                                                                                      \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                                                                    7. Step-by-step derivation
                                                                                                      1. Applied rewrites59.0%

                                                                                                        \[\leadsto \frac{-1 - x}{B} \]

                                                                                                      if -9.59999999999999963e-37 < F

                                                                                                      1. Initial program 80.6%

                                                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                      2. Add Preprocessing
                                                                                                      3. Taylor expanded in B around 0

                                                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                      4. Step-by-step derivation
                                                                                                        1. lower-/.f64N/A

                                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                        2. sub-negN/A

                                                                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                        3. *-commutativeN/A

                                                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        4. lower-fma.f64N/A

                                                                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                        5. lower-sqrt.f64N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        6. lower-/.f64N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        7. associate-+r+N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        8. +-commutativeN/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        9. unpow2N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        10. lower-fma.f64N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        11. +-commutativeN/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        12. lower-fma.f64N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        13. lower-neg.f6449.2

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                                      5. Applied rewrites49.2%

                                                                                                        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                                      6. Taylor expanded in F around 0

                                                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                      7. Step-by-step derivation
                                                                                                        1. Applied rewrites30.1%

                                                                                                          \[\leadsto \frac{-x}{B} \]
                                                                                                      8. Recombined 2 regimes into one program.
                                                                                                      9. Add Preprocessing

                                                                                                      Alternative 22: 29.7% accurate, 26.3× speedup?

                                                                                                      \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                                                                      (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                                                                      double code(double F, double B, double x) {
                                                                                                      	return -x / B;
                                                                                                      }
                                                                                                      
                                                                                                      real(8) function code(f, b, x)
                                                                                                          real(8), intent (in) :: f
                                                                                                          real(8), intent (in) :: b
                                                                                                          real(8), intent (in) :: x
                                                                                                          code = -x / b
                                                                                                      end function
                                                                                                      
                                                                                                      public static double code(double F, double B, double x) {
                                                                                                      	return -x / B;
                                                                                                      }
                                                                                                      
                                                                                                      def code(F, B, x):
                                                                                                      	return -x / B
                                                                                                      
                                                                                                      function code(F, B, x)
                                                                                                      	return Float64(Float64(-x) / B)
                                                                                                      end
                                                                                                      
                                                                                                      function tmp = code(F, B, x)
                                                                                                      	tmp = -x / B;
                                                                                                      end
                                                                                                      
                                                                                                      code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                                                                      
                                                                                                      \begin{array}{l}
                                                                                                      
                                                                                                      \\
                                                                                                      \frac{-x}{B}
                                                                                                      \end{array}
                                                                                                      
                                                                                                      Derivation
                                                                                                      1. Initial program 75.5%

                                                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                      2. Add Preprocessing
                                                                                                      3. Taylor expanded in B around 0

                                                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                      4. Step-by-step derivation
                                                                                                        1. lower-/.f64N/A

                                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                        2. sub-negN/A

                                                                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                        3. *-commutativeN/A

                                                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        4. lower-fma.f64N/A

                                                                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                        5. lower-sqrt.f64N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        6. lower-/.f64N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        7. associate-+r+N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        8. +-commutativeN/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        9. unpow2N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        10. lower-fma.f64N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        11. +-commutativeN/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        12. lower-fma.f64N/A

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                        13. lower-neg.f6450.9

                                                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                                      5. Applied rewrites50.9%

                                                                                                        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                                      6. Taylor expanded in F around 0

                                                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                      7. Step-by-step derivation
                                                                                                        1. Applied rewrites32.5%

                                                                                                          \[\leadsto \frac{-x}{B} \]
                                                                                                        2. Add Preprocessing

                                                                                                        Alternative 23: 10.2% accurate, 30.7× speedup?

                                                                                                        \[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
                                                                                                        (FPCore (F B x) :precision binary64 (/ -1.0 B))
                                                                                                        double code(double F, double B, double x) {
                                                                                                        	return -1.0 / B;
                                                                                                        }
                                                                                                        
                                                                                                        real(8) function code(f, b, x)
                                                                                                            real(8), intent (in) :: f
                                                                                                            real(8), intent (in) :: b
                                                                                                            real(8), intent (in) :: x
                                                                                                            code = (-1.0d0) / b
                                                                                                        end function
                                                                                                        
                                                                                                        public static double code(double F, double B, double x) {
                                                                                                        	return -1.0 / B;
                                                                                                        }
                                                                                                        
                                                                                                        def code(F, B, x):
                                                                                                        	return -1.0 / B
                                                                                                        
                                                                                                        function code(F, B, x)
                                                                                                        	return Float64(-1.0 / B)
                                                                                                        end
                                                                                                        
                                                                                                        function tmp = code(F, B, x)
                                                                                                        	tmp = -1.0 / B;
                                                                                                        end
                                                                                                        
                                                                                                        code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
                                                                                                        
                                                                                                        \begin{array}{l}
                                                                                                        
                                                                                                        \\
                                                                                                        \frac{-1}{B}
                                                                                                        \end{array}
                                                                                                        
                                                                                                        Derivation
                                                                                                        1. Initial program 75.5%

                                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                        2. Add Preprocessing
                                                                                                        3. Taylor expanded in B around 0

                                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                        4. Step-by-step derivation
                                                                                                          1. lower-/.f64N/A

                                                                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                          2. sub-negN/A

                                                                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                          3. *-commutativeN/A

                                                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                          4. lower-fma.f64N/A

                                                                                                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                                          5. lower-sqrt.f64N/A

                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                          6. lower-/.f64N/A

                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                          7. associate-+r+N/A

                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                          8. +-commutativeN/A

                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                          9. unpow2N/A

                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                          10. lower-fma.f64N/A

                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                          11. +-commutativeN/A

                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                          12. lower-fma.f64N/A

                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                          13. lower-neg.f6450.9

                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                                        5. Applied rewrites50.9%

                                                                                                          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                                        6. Taylor expanded in F around -inf

                                                                                                          \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                                                                        7. Step-by-step derivation
                                                                                                          1. Applied rewrites31.4%

                                                                                                            \[\leadsto \frac{-1 - x}{B} \]
                                                                                                          2. Taylor expanded in x around 0

                                                                                                            \[\leadsto \frac{-1}{B} \]
                                                                                                          3. Step-by-step derivation
                                                                                                            1. Applied rewrites8.5%

                                                                                                              \[\leadsto \frac{-1}{B} \]
                                                                                                            2. Add Preprocessing

                                                                                                            Reproduce

                                                                                                            ?
                                                                                                            herbie shell --seed 2024240 
                                                                                                            (FPCore (F B x)
                                                                                                              :name "VandenBroeck and Keller, Equation (23)"
                                                                                                              :precision binary64
                                                                                                              (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))