VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.8% → 99.6%
Time: 15.3s
Alternatives: 27
Speedup: 2.0×

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 27 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: 76.8% 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.6% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.65 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq 1000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


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

    1. Initial program 41.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(-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. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      5. associate-*l/N/A

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

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

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

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

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

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

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

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

      if -1.65e154 < F < 1e3

      1. Initial program 97.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(-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. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. associate-*l/N/A

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

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

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

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

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

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

      if 1e3 < F

      1. Initial program 58.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 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.8

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

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

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

      Alternative 2: 99.6% accurate, 1.4× speedup?

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

        1. Initial program 47.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(-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. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
          5. associate-*l/N/A

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

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

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

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

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

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

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

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

          if -2.00000000000000003e100 < F < 1e3

          1. Initial program 98.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(-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. +-commutativeN/A

              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
            5. associate-*l/N/A

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

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

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

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

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

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

          if 1e3 < F

          1. Initial program 58.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 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.8

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

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

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

          Alternative 3: 99.7% accurate, 1.4× speedup?

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

            1. Initial program 53.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. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \color{blue}{\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. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
              5. associate-*l/N/A

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

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

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

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

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

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

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

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

              if -2e65 < F < 1.2e8

              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. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \color{blue}{\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. +-commutativeN/A

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                5. associate-*l/N/A

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

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

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

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

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

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

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

                  \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}}{\sin B} - \frac{x}{\tan B} \]
                3. associate-/l/N/A

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

                  \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} - \frac{x}{\tan B} \]
                5. lower-*.f6499.6

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

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

                  \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{x \cdot 2} + \mathsf{fma}\left(F, F, 2\right)}} - \frac{x}{\tan B} \]
                8. lower-fma.f6499.6

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

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

              if 1.2e8 < F

              1. Initial program 58.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 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.8

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

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

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

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

              Alternative 4: 99.0% accurate, 1.4× speedup?

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

                1. Initial program 58.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(-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. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  5. associate-*l/N/A

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

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

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

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

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

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

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

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

                  if -58 < F < 1.5

                  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. Step-by-step derivation
                    1. lift-+.f64N/A

                      \[\leadsto \color{blue}{\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. +-commutativeN/A

                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                    5. associate-*l/N/A

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \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.7

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

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

                  if 1.5 < F

                  1. Initial program 59.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.f6498.8

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

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

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

                  Alternative 5: 85.8% accurate, 1.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{+117}:\\ \;\;\;\;\mathsf{fma}\left(1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\ \mathbf{elif}\;F \leq -1.12 \cdot 10^{-38}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - 1 \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 3000:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (if (<= F -2.4e+117)
                     (fma 1.0 (/ -1.0 B) (/ (- x) (tan B)))
                     (if (<= F -1.12e-38)
                       (/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (* 1.0 x)) (sin B))
                       (if (<= F 3000.0)
                         (- (* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B)) (/ x (tan B)))
                         (/ (- 1.0 (* (cos B) x)) (sin B))))))
                  double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= -2.4e+117) {
                  		tmp = fma(1.0, (-1.0 / B), (-x / tan(B)));
                  	} else if (F <= -1.12e-38) {
                  		tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - (1.0 * x)) / sin(B);
                  	} else if (F <= 3000.0) {
                  		tmp = (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B)) - (x / tan(B));
                  	} else {
                  		tmp = (1.0 - (cos(B) * x)) / sin(B);
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	tmp = 0.0
                  	if (F <= -2.4e+117)
                  		tmp = fma(1.0, Float64(-1.0 / B), Float64(Float64(-x) / tan(B)));
                  	elseif (F <= -1.12e-38)
                  		tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - Float64(1.0 * x)) / sin(B));
                  	elseif (F <= 3000.0)
                  		tmp = Float64(Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B)) - Float64(x / tan(B)));
                  	else
                  		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := If[LessEqual[F, -2.4e+117], N[(1.0 * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.12e-38], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(1.0 * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3000.0], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $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 -2.4 \cdot 10^{+117}:\\
                  \;\;\;\;\mathsf{fma}\left(1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
                  
                  \mathbf{elif}\;F \leq -1.12 \cdot 10^{-38}:\\
                  \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - 1 \cdot x}{\sin B}\\
                  
                  \mathbf{elif}\;F \leq 3000:\\
                  \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if F < -2.3999999999999999e117

                    1. Initial program 45.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(-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. +-commutativeN/A

                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                      5. associate-*l/N/A

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{-1}{B}}, \frac{-x}{\tan B}\right) \]
                      3. Step-by-step derivation
                        1. lower-/.f6475.3

                          \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{-1}{B}}, \frac{-x}{\tan B}\right) \]
                      4. Applied rewrites75.3%

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

                      if -2.3999999999999999e117 < F < -1.1200000000000001e-38

                      1. Initial program 93.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(-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. +-commutativeN/A

                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                        5. associate-*l/N/A

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

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

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

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

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

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

                        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \color{blue}{1} \cdot x}{\sin B} \]
                      7. Step-by-step derivation
                        1. Applied rewrites82.4%

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

                        if -1.1200000000000001e-38 < F < 3e3

                        1. Initial program 99.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(-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. +-commutativeN/A

                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                          5. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 3e3 < F

                        1. Initial program 58.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 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.8

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

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

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

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

                        Alternative 6: 91.2% accurate, 1.5× speedup?

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

                          1. Initial program 62.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(-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. +-commutativeN/A

                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                            5. associate-*l/N/A

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

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

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

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

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

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

                            \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                          7. Step-by-step derivation
                            1. Applied rewrites94.3%

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

                            if -5.6e-38 < F < 3e3

                            1. Initial program 99.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(-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. +-commutativeN/A

                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                              5. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 3e3 < F

                            1. Initial program 58.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 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.8

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

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

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

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

                            Alternative 7: 91.2% accurate, 1.5× speedup?

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

                              1. Initial program 62.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(-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. +-commutativeN/A

                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                5. associate-*l/N/A

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

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

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

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

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

                                \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \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 rewrites94.2%

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

                                if -5.6e-38 < F < 3e3

                                1. Initial program 99.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(-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. +-commutativeN/A

                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                  5. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if 3e3 < F

                                1. Initial program 58.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 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.8

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

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

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

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

                                Alternative 8: 91.2% accurate, 1.6× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos B \cdot x\\ \mathbf{if}\;F \leq -5.6 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1 - t\_0}{\sin B}\\ \mathbf{elif}\;F \leq 3000:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \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 -5.6e-38)
                                     (/ (- -1.0 t_0) (sin B))
                                     (if (<= F 3000.0)
                                       (- (* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B)) (/ x (tan B)))
                                       (/ (- 1.0 t_0) (sin B))))))
                                double code(double F, double B, double x) {
                                	double t_0 = cos(B) * x;
                                	double tmp;
                                	if (F <= -5.6e-38) {
                                		tmp = (-1.0 - t_0) / sin(B);
                                	} else if (F <= 3000.0) {
                                		tmp = (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B)) - (x / tan(B));
                                	} 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 <= -5.6e-38)
                                		tmp = Float64(Float64(-1.0 - t_0) / sin(B));
                                	elseif (F <= 3000.0)
                                		tmp = Float64(Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B)) - Float64(x / tan(B)));
                                	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, -5.6e-38], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3000.0], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $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 -5.6 \cdot 10^{-38}:\\
                                \;\;\;\;\frac{-1 - t\_0}{\sin B}\\
                                
                                \mathbf{elif}\;F \leq 3000:\\
                                \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{1 - t\_0}{\sin B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if F < -5.6e-38

                                  1. Initial program 62.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(-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. +-commutativeN/A

                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                    5. associate-*l/N/A

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

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

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

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

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

                                    \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \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 rewrites94.2%

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

                                    if -5.6e-38 < F < 3e3

                                    1. Initial program 99.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(-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. +-commutativeN/A

                                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                      5. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if 3e3 < F

                                    1. Initial program 58.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 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.8

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

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

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

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

                                    Alternative 9: 79.1% accurate, 2.0× speedup?

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

                                      1. Initial program 45.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(-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. +-commutativeN/A

                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                        5. associate-*l/N/A

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

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

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

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{-1}{B}}, \frac{-x}{\tan B}\right) \]
                                        3. Step-by-step derivation
                                          1. lower-/.f6475.3

                                            \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{-1}{B}}, \frac{-x}{\tan B}\right) \]
                                        4. Applied rewrites75.3%

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

                                        if -2.3999999999999999e117 < F < -1.1200000000000001e-38

                                        1. Initial program 93.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(-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. +-commutativeN/A

                                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                          5. associate-*l/N/A

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

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

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

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

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

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

                                          \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \color{blue}{1} \cdot x}{\sin B} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites82.4%

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

                                          if -1.1200000000000001e-38 < F < 3.50000000000000006e50

                                          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. Step-by-step derivation
                                            1. lift-+.f64N/A

                                              \[\leadsto \color{blue}{\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. +-commutativeN/A

                                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                            5. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          if 3.50000000000000006e50 < F

                                          1. Initial program 53.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.7

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

                                            \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
                                          6. Taylor expanded in B around 0

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

                                              \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                          8. Recombined 4 regimes into one program.
                                          9. Final simplification82.2%

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

                                          Alternative 10: 76.7% accurate, 2.2× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;x \leq -2.25 \cdot 10^{-37}:\\ \;\;\;\;\mathsf{fma}\left(1, \frac{-1}{B}, t\_0\right)\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-54}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - 1 \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (let* ((t_0 (/ (- x) (tan B))))
                                             (if (<= x -2.25e-37)
                                               (fma 1.0 (/ -1.0 B) t_0)
                                               (if (<= x 9.2e-54)
                                                 (/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (* 1.0 x)) (sin B))
                                                 t_0))))
                                          double code(double F, double B, double x) {
                                          	double t_0 = -x / tan(B);
                                          	double tmp;
                                          	if (x <= -2.25e-37) {
                                          		tmp = fma(1.0, (-1.0 / B), t_0);
                                          	} else if (x <= 9.2e-54) {
                                          		tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - (1.0 * 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 <= -2.25e-37)
                                          		tmp = fma(1.0, Float64(-1.0 / B), t_0);
                                          	elseif (x <= 9.2e-54)
                                          		tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - Float64(1.0 * 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, -2.25e-37], N[(1.0 * N[(-1.0 / B), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x, 9.2e-54], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(1.0 * x), $MachinePrecision]), $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 -2.25 \cdot 10^{-37}:\\
                                          \;\;\;\;\mathsf{fma}\left(1, \frac{-1}{B}, t\_0\right)\\
                                          
                                          \mathbf{elif}\;x \leq 9.2 \cdot 10^{-54}:\\
                                          \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - 1 \cdot x}{\sin B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if x < -2.2500000000000002e-37

                                            1. Initial program 75.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(-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. +-commutativeN/A

                                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                              5. associate-*l/N/A

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

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{-1}{B}}, \frac{-x}{\tan B}\right) \]
                                              3. Step-by-step derivation
                                                1. lower-/.f6490.7

                                                  \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{-1}{B}}, \frac{-x}{\tan B}\right) \]
                                              4. Applied rewrites90.7%

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

                                              if -2.2500000000000002e-37 < x < 9.1999999999999996e-54

                                              1. Initial program 72.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(-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. +-commutativeN/A

                                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                5. associate-*l/N/A

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

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

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

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

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

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

                                                \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \color{blue}{1} \cdot x}{\sin B} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites67.2%

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

                                                if 9.1999999999999996e-54 < x

                                                1. Initial program 92.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. Step-by-step derivation
                                                  1. lift-+.f64N/A

                                                    \[\leadsto \color{blue}{\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. +-commutativeN/A

                                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                  5. associate-*l/N/A

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

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

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

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

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

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

                                                  \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                7. 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(-x\right)} \cdot \frac{\cos B}{\sin B} \]
                                                  6. lower-/.f64N/A

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

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

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

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

                                                    \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                                10. Recombined 3 regimes into one program.
                                                11. Add Preprocessing

                                                Alternative 11: 76.7% accurate, 2.2× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;x \leq -2.25 \cdot 10^{-37}:\\ \;\;\;\;\mathsf{fma}\left(1, \frac{-1}{B}, t\_0\right)\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-54}:\\ \;\;\;\;\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 -2.25e-37)
                                                     (fma 1.0 (/ -1.0 B) t_0)
                                                     (if (<= x 9.2e-54)
                                                       (/ (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 <= -2.25e-37) {
                                                		tmp = fma(1.0, (-1.0 / B), t_0);
                                                	} else if (x <= 9.2e-54) {
                                                		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 <= -2.25e-37)
                                                		tmp = fma(1.0, Float64(-1.0 / B), t_0);
                                                	elseif (x <= 9.2e-54)
                                                		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, -2.25e-37], N[(1.0 * N[(-1.0 / B), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x, 9.2e-54], 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 -2.25 \cdot 10^{-37}:\\
                                                \;\;\;\;\mathsf{fma}\left(1, \frac{-1}{B}, t\_0\right)\\
                                                
                                                \mathbf{elif}\;x \leq 9.2 \cdot 10^{-54}:\\
                                                \;\;\;\;\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 3 regimes
                                                2. if x < -2.2500000000000002e-37

                                                  1. Initial program 75.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(-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. +-commutativeN/A

                                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                    5. associate-*l/N/A

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

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

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

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

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

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

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

                                                      \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{-1}{B}}, \frac{-x}{\tan B}\right) \]
                                                    3. Step-by-step derivation
                                                      1. lower-/.f6490.7

                                                        \[\leadsto \mathsf{fma}\left(1, \color{blue}{\frac{-1}{B}}, \frac{-x}{\tan B}\right) \]
                                                    4. Applied rewrites90.7%

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

                                                    if -2.2500000000000002e-37 < x < 9.1999999999999996e-54

                                                    1. Initial program 72.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(-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. +-commutativeN/A

                                                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                      5. associate-*l/N/A

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

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

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

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

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

                                                      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \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.f6467.0

                                                        \[\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 rewrites67.0%

                                                      \[\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 9.1999999999999996e-54 < x

                                                    1. Initial program 92.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. Step-by-step derivation
                                                      1. lift-+.f64N/A

                                                        \[\leadsto \color{blue}{\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. +-commutativeN/A

                                                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                      5. associate-*l/N/A

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

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

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

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

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

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

                                                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                    7. 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(-x\right)} \cdot \frac{\cos B}{\sin B} \]
                                                      6. lower-/.f64N/A

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

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

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

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

                                                        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                                    10. Recombined 3 regimes into one program.
                                                    11. Add Preprocessing

                                                    Alternative 12: 56.4% accurate, 2.7× speedup?

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

                                                      1. Initial program 76.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(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
                                                      4. Step-by-step derivation
                                                        1. +-commutativeN/A

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

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

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

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

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

                                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}{B}} \]
                                                      5. Applied rewrites63.9%

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

                                                        \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right) - x}{B}} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(B \cdot B, \frac{1}{6} \cdot F, F\right)}{B} \]
                                                      7. Step-by-step derivation
                                                        1. lower-/.f64N/A

                                                          \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right) - x}{B}} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(B \cdot B, \frac{1}{6} \cdot F, F\right)}{B} \]
                                                      8. Applied rewrites58.8%

                                                        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(-0.3333333333333333, x \cdot 0.022222222222222223, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -x\right)}{B}} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right)}{B} \]
                                                      9. Applied rewrites58.9%

                                                        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{B} + \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.007407407407407408, x, 0.009523809523809525 \cdot x\right) \cdot B, B, 0.022222222222222223 \cdot x\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -x\right)}{B}} \]

                                                      if 63 < B

                                                      1. Initial program 87.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(-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. +-commutativeN/A

                                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                        5. associate-*l/N/A

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

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

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

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

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

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

                                                        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                      7. 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(-x\right)} \cdot \frac{\cos B}{\sin B} \]
                                                        6. lower-/.f64N/A

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

                                                          \[\leadsto \left(-x\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                                                        8. lower-sin.f6465.6

                                                          \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                                                      8. Applied rewrites65.6%

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

                                                          \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                                      10. Recombined 2 regimes into one program.
                                                      11. Final simplification60.8%

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 63:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.007407407407407408, x, 0.009523809523809525 \cdot x\right) \cdot B, B, 0.022222222222222223 \cdot x\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -x\right)}{B} + \frac{\frac{\mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \end{array} \]
                                                      12. Add Preprocessing

                                                      Alternative 13: 50.3% accurate, 2.9× speedup?

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

                                                        1. Initial program 41.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.f6420.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 rewrites20.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 \cdot \left(1 + x\right)}{B} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites39.5%

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

                                                              \[\leadsto \frac{\frac{1}{\frac{-1 + x}{1 - x \cdot x}}}{B} \]

                                                            if -1.65e154 < F < 1.19999999999999999e167

                                                            1. Initial program 95.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. Step-by-step derivation
                                                              1. lift-+.f64N/A

                                                                \[\leadsto \color{blue}{\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. +-commutativeN/A

                                                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                              5. associate-*l/N/A

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

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

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

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

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

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

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

                                                                \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                                                            8. Applied rewrites54.2%

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

                                                            if 1.19999999999999999e167 < F

                                                            1. Initial program 31.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}{\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.7

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

                                                              \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
                                                            6. Taylor expanded in x around 0

                                                              \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites64.5%

                                                                \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                                            8. Recombined 3 regimes into one program.
                                                            9. Final simplification52.6%

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

                                                            Alternative 14: 50.1% accurate, 3.0× speedup?

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

                                                              1. Initial program 42.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.f6420.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 rewrites20.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 rewrites38.7%

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

                                                                    \[\leadsto \frac{\frac{1}{\frac{-1 + x}{1 - x \cdot x}}}{B} \]

                                                                  if -3.90000000000000018e144 < F < 1.19999999999999999e167

                                                                  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{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                                                                  4. Step-by-step derivation
                                                                    1. lower-/.f64N/A

                                                                      \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                                                                  5. Applied rewrites54.2%

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

                                                                  if 1.19999999999999999e167 < F

                                                                  1. Initial program 31.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}{\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.7

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

                                                                    \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
                                                                  6. Taylor expanded in x around 0

                                                                    \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites64.5%

                                                                      \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                                                  8. Recombined 3 regimes into one program.
                                                                  9. Final simplification52.3%

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

                                                                  Alternative 15: 56.5% accurate, 3.1× speedup?

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

                                                                    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 B around 0

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

                                                                        \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                                                                    5. Applied rewrites59.3%

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

                                                                    if 0.00169999999999999991 < B

                                                                    1. Initial program 86.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(-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. +-commutativeN/A

                                                                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                      5. associate-*l/N/A

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

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

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

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

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

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

                                                                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                                    7. 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(-x\right)} \cdot \frac{\cos B}{\sin B} \]
                                                                      6. lower-/.f64N/A

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

                                                                        \[\leadsto \left(-x\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                                                                      8. lower-sin.f6463.9

                                                                        \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                                                                    8. Applied rewrites63.9%

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

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

                                                                    Alternative 16: 50.3% accurate, 3.8× speedup?

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

                                                                      1. Initial program 42.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.f6420.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 rewrites20.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 rewrites38.7%

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

                                                                            \[\leadsto \frac{\frac{1}{\frac{-1 + x}{1 - x \cdot x}}}{B} \]

                                                                          if -3.90000000000000018e144 < F < 1.19999999999999999e167

                                                                          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{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                                                                          4. Step-by-step derivation
                                                                            1. lower-/.f64N/A

                                                                              \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                                                                          5. Applied rewrites54.2%

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

                                                                          if 1.19999999999999999e167 < F

                                                                          1. Initial program 31.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}{\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.7

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

                                                                            \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
                                                                          6. Taylor expanded in B around 0

                                                                            \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites72.3%

                                                                              \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                                            2. Taylor expanded in B around 0

                                                                              \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} - \frac{x}{B} \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites48.1%

                                                                                \[\leadsto \frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{B} \]
                                                                            4. Recombined 3 regimes into one program.
                                                                            5. Final simplification50.8%

                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.9 \cdot 10^{+144}:\\ \;\;\;\;\frac{\frac{1}{\frac{x + -1}{1 - x \cdot x}}}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{+167}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right), \mathsf{fma}\left(0.3333333333333333, \left(B \cdot B\right) \cdot x, -x\right)\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{B}\\ \end{array} \]
                                                                            6. Add Preprocessing

                                                                            Alternative 17: 49.9% accurate, 6.1× speedup?

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

                                                                              1. Initial program 63.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.f6430.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 rewrites30.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 -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 rewrites36.9%

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

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

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

                                                                                  if -1.9000000000000002e-52 < F < 2.8e8

                                                                                  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.f6454.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 rewrites54.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. Applied rewrites54.7%

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

                                                                                  if 2.8e8 < F

                                                                                  1. Initial program 58.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 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.8

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

                                                                                    \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
                                                                                  6. Taylor expanded in B around 0

                                                                                    \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                                                  7. Step-by-step derivation
                                                                                    1. Applied rewrites76.5%

                                                                                      \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                                                    2. Taylor expanded in B around 0

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

                                                                                        \[\leadsto \frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{B} \]
                                                                                    4. Recombined 3 regimes into one program.
                                                                                    5. Add Preprocessing

                                                                                    Alternative 18: 49.7% accurate, 6.2× speedup?

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

                                                                                      1. Initial program 63.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.f6430.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 rewrites30.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 -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 rewrites36.9%

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

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

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

                                                                                          if -1.9000000000000002e-52 < F < 1.5

                                                                                          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.f6454.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 rewrites54.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{\mathsf{fma}\left(\sqrt{\frac{1}{2 + 2 \cdot x}}, F, -x\right)}{B} \]
                                                                                          7. Step-by-step derivation
                                                                                            1. Applied rewrites53.7%

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

                                                                                            if 1.5 < F

                                                                                            1. Initial program 59.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.f6498.8

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

                                                                                              \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
                                                                                            6. Taylor expanded in B around 0

                                                                                              \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                                                            7. Step-by-step derivation
                                                                                              1. Applied rewrites76.0%

                                                                                                \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                                                              2. Taylor expanded in B around 0

                                                                                                \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)} - \frac{x}{B} \]
                                                                                              3. Step-by-step derivation
                                                                                                1. Applied rewrites58.6%

                                                                                                  \[\leadsto \frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{B} \]
                                                                                              4. Recombined 3 regimes into one program.
                                                                                              5. Add Preprocessing

                                                                                              Alternative 19: 42.0% accurate, 6.6× speedup?

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

                                                                                                1. Initial program 64.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.f6432.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 rewrites32.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 F around -inf

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

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

                                                                                                      \[\leadsto \frac{\frac{1}{\frac{-1 + x}{1 - x \cdot x}}}{B} \]

                                                                                                    if -9.2000000000000001e-57 < F < -1.42e-211

                                                                                                    1. Initial program 99.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.f6472.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 rewrites72.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 x around 0

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

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

                                                                                                      if -1.42e-211 < F < 4.5999999999999996e-19

                                                                                                      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.f6447.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 rewrites47.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.3%

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

                                                                                                        if 4.5999999999999996e-19 < F

                                                                                                        1. Initial program 63.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.f6491.5

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

                                                                                                          \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
                                                                                                        6. Taylor expanded in B around 0

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

                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(0.16666666666666666 + 0.3333333333333333 \cdot x, B \cdot B, 1\right) - x}{\color{blue}{B}} \]
                                                                                                        8. Recombined 4 regimes into one program.
                                                                                                        9. Final simplification44.2%

                                                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.2 \cdot 10^{-57}:\\ \;\;\;\;\frac{\frac{1}{\frac{x + -1}{1 - x \cdot x}}}{B}\\ \mathbf{elif}\;F \leq -1.42 \cdot 10^{-211}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-19}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.3333333333333333 \cdot x + 0.16666666666666666, B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                                                                                                        10. Add Preprocessing

                                                                                                        Alternative 20: 42.8% accurate, 6.6× speedup?

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

                                                                                                          1. Initial program 64.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.f6432.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 rewrites32.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 F around -inf

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

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

                                                                                                            if -5.19999999999999971e-57 < F < -1.42e-211

                                                                                                            1. Initial program 99.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.f6472.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 rewrites72.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 x around 0

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

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

                                                                                                              if -1.42e-211 < F < 4.5999999999999996e-19

                                                                                                              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.f6447.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 rewrites47.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.3%

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

                                                                                                                if 4.5999999999999996e-19 < F

                                                                                                                1. Initial program 63.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.f6491.5

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

                                                                                                                  \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
                                                                                                                6. Taylor expanded in B around 0

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

                                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(0.16666666666666666 + 0.3333333333333333 \cdot x, B \cdot B, 1\right) - x}{\color{blue}{B}} \]
                                                                                                                8. Recombined 4 regimes into one program.
                                                                                                                9. Final simplification44.1%

                                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{-57}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -1.42 \cdot 10^{-211}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-19}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.3333333333333333 \cdot x + 0.16666666666666666, B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                                                                                                                10. Add Preprocessing

                                                                                                                Alternative 21: 43.7% accurate, 7.5× speedup?

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

                                                                                                                  1. Initial program 63.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.f6430.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 rewrites30.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 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 rewrites37.3%

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

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

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

                                                                                                                      if -1.01999999999999998e-38 < F < 4.5999999999999996e-19

                                                                                                                      1. Initial program 99.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(-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. +-commutativeN/A

                                                                                                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                                                                        5. associate-*l/N/A

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

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

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

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

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

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

                                                                                                                        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                                                                                      7. 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(-x\right)} \cdot \frac{\cos B}{\sin B} \]
                                                                                                                        6. lower-/.f64N/A

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

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

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

                                                                                                                        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
                                                                                                                      9. Taylor expanded in B around 0

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

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

                                                                                                                        if 4.5999999999999996e-19 < F

                                                                                                                        1. Initial program 63.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.f6491.5

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

                                                                                                                          \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
                                                                                                                        6. Taylor expanded in B around 0

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

                                                                                                                            \[\leadsto \frac{\mathsf{fma}\left(0.16666666666666666 + 0.3333333333333333 \cdot x, B \cdot B, 1\right) - x}{\color{blue}{B}} \]
                                                                                                                        8. Recombined 3 regimes into one program.
                                                                                                                        9. Final simplification40.7%

                                                                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.02 \cdot 10^{-38}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{0.5}{F}, \frac{2}{F}, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-19}:\\ \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.3333333333333333 \cdot x + 0.16666666666666666, B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                                                                                                                        10. Add Preprocessing

                                                                                                                        Alternative 22: 43.8% accurate, 8.0× speedup?

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

                                                                                                                          1. Initial program 60.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.f6430.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 rewrites30.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 -inf

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

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

                                                                                                                            if -1.20000000000000005e-25 < F < 4.5999999999999996e-19

                                                                                                                            1. Initial program 99.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(-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. +-commutativeN/A

                                                                                                                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                                                                              5. associate-*l/N/A

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

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

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

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

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

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

                                                                                                                              \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                                                                                            7. 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(-x\right)} \cdot \frac{\cos B}{\sin B} \]
                                                                                                                              6. lower-/.f64N/A

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

                                                                                                                                \[\leadsto \left(-x\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                                                                                                                              8. lower-sin.f6467.1

                                                                                                                                \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                                                                                                                            8. Applied rewrites67.1%

                                                                                                                              \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
                                                                                                                            9. Taylor expanded in B around 0

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

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

                                                                                                                              if 4.5999999999999996e-19 < F

                                                                                                                              1. Initial program 63.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.f6491.5

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

                                                                                                                                \[\leadsto \color{blue}{\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}} \]
                                                                                                                              6. Taylor expanded in B around 0

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

                                                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(0.16666666666666666 + 0.3333333333333333 \cdot x, B \cdot B, 1\right) - x}{\color{blue}{B}} \]
                                                                                                                              8. Recombined 3 regimes into one program.
                                                                                                                              9. Final simplification40.7%

                                                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.2 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-19}:\\ \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.3333333333333333 \cdot x + 0.16666666666666666, B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                                                                                                                              10. Add Preprocessing

                                                                                                                              Alternative 23: 43.8% accurate, 8.8× speedup?

                                                                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.2 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.12 \cdot 10^{-35}:\\ \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                                                                              (FPCore (F B x)
                                                                                                                               :precision binary64
                                                                                                                               (if (<= F -1.2e-25)
                                                                                                                                 (/ (- -1.0 x) B)
                                                                                                                                 (if (<= F 1.12e-35)
                                                                                                                                   (/ (- (* (* (* B B) x) 0.3333333333333333) x) B)
                                                                                                                                   (/ (- 1.0 x) B))))
                                                                                                                              double code(double F, double B, double x) {
                                                                                                                              	double tmp;
                                                                                                                              	if (F <= -1.2e-25) {
                                                                                                                              		tmp = (-1.0 - x) / B;
                                                                                                                              	} else if (F <= 1.12e-35) {
                                                                                                                              		tmp = ((((B * B) * x) * 0.3333333333333333) - 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 <= (-1.2d-25)) then
                                                                                                                                      tmp = ((-1.0d0) - x) / b
                                                                                                                                  else if (f <= 1.12d-35) then
                                                                                                                                      tmp = ((((b * b) * x) * 0.3333333333333333d0) - 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 <= -1.2e-25) {
                                                                                                                              		tmp = (-1.0 - x) / B;
                                                                                                                              	} else if (F <= 1.12e-35) {
                                                                                                                              		tmp = ((((B * B) * x) * 0.3333333333333333) - x) / B;
                                                                                                                              	} else {
                                                                                                                              		tmp = (1.0 - x) / B;
                                                                                                                              	}
                                                                                                                              	return tmp;
                                                                                                                              }
                                                                                                                              
                                                                                                                              def code(F, B, x):
                                                                                                                              	tmp = 0
                                                                                                                              	if F <= -1.2e-25:
                                                                                                                              		tmp = (-1.0 - x) / B
                                                                                                                              	elif F <= 1.12e-35:
                                                                                                                              		tmp = ((((B * B) * x) * 0.3333333333333333) - x) / B
                                                                                                                              	else:
                                                                                                                              		tmp = (1.0 - x) / B
                                                                                                                              	return tmp
                                                                                                                              
                                                                                                                              function code(F, B, x)
                                                                                                                              	tmp = 0.0
                                                                                                                              	if (F <= -1.2e-25)
                                                                                                                              		tmp = Float64(Float64(-1.0 - x) / B);
                                                                                                                              	elseif (F <= 1.12e-35)
                                                                                                                              		tmp = Float64(Float64(Float64(Float64(Float64(B * B) * x) * 0.3333333333333333) - 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 <= -1.2e-25)
                                                                                                                              		tmp = (-1.0 - x) / B;
                                                                                                                              	elseif (F <= 1.12e-35)
                                                                                                                              		tmp = ((((B * B) * x) * 0.3333333333333333) - x) / B;
                                                                                                                              	else
                                                                                                                              		tmp = (1.0 - x) / B;
                                                                                                                              	end
                                                                                                                              	tmp_2 = tmp;
                                                                                                                              end
                                                                                                                              
                                                                                                                              code[F_, B_, x_] := If[LessEqual[F, -1.2e-25], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.12e-35], N[(N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - 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^{-25}:\\
                                                                                                                              \;\;\;\;\frac{-1 - x}{B}\\
                                                                                                                              
                                                                                                                              \mathbf{elif}\;F \leq 1.12 \cdot 10^{-35}:\\
                                                                                                                              \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\\
                                                                                                                              
                                                                                                                              \mathbf{else}:\\
                                                                                                                              \;\;\;\;\frac{1 - x}{B}\\
                                                                                                                              
                                                                                                                              
                                                                                                                              \end{array}
                                                                                                                              \end{array}
                                                                                                                              
                                                                                                                              Derivation
                                                                                                                              1. Split input into 3 regimes
                                                                                                                              2. if F < -1.20000000000000005e-25

                                                                                                                                1. Initial program 60.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.f6430.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 rewrites30.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 -inf

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

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

                                                                                                                                  if -1.20000000000000005e-25 < F < 1.12e-35

                                                                                                                                  1. Initial program 99.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(-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. +-commutativeN/A

                                                                                                                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                                                                                    5. associate-*l/N/A

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

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

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

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

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

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

                                                                                                                                    \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                                                                                                  7. 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(-x\right)} \cdot \frac{\cos B}{\sin B} \]
                                                                                                                                    6. lower-/.f64N/A

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

                                                                                                                                      \[\leadsto \left(-x\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                                                                                                                                    8. lower-sin.f6467.2

                                                                                                                                      \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                                                                                                                                  8. Applied rewrites67.2%

                                                                                                                                    \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
                                                                                                                                  9. Taylor expanded in B around 0

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

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

                                                                                                                                    if 1.12e-35 < F

                                                                                                                                    1. Initial program 66.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.f6442.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 rewrites42.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 inf

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

                                                                                                                                        \[\leadsto \frac{1 - x}{B} \]
                                                                                                                                    8. Recombined 3 regimes into one program.
                                                                                                                                    9. Final simplification40.6%

                                                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.2 \cdot 10^{-25}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.12 \cdot 10^{-35}:\\ \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                                                                                                                    10. Add Preprocessing

                                                                                                                                    Alternative 24: 43.4% accurate, 13.6× speedup?

                                                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-108}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.4 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                                                                                    (FPCore (F B x)
                                                                                                                                     :precision binary64
                                                                                                                                     (if (<= F -3.8e-108)
                                                                                                                                       (/ (- -1.0 x) B)
                                                                                                                                       (if (<= F 6.4e-68) (/ (- x) B) (/ (- 1.0 x) B))))
                                                                                                                                    double code(double F, double B, double x) {
                                                                                                                                    	double tmp;
                                                                                                                                    	if (F <= -3.8e-108) {
                                                                                                                                    		tmp = (-1.0 - x) / B;
                                                                                                                                    	} else if (F <= 6.4e-68) {
                                                                                                                                    		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 <= (-3.8d-108)) then
                                                                                                                                            tmp = ((-1.0d0) - x) / b
                                                                                                                                        else if (f <= 6.4d-68) 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 <= -3.8e-108) {
                                                                                                                                    		tmp = (-1.0 - x) / B;
                                                                                                                                    	} else if (F <= 6.4e-68) {
                                                                                                                                    		tmp = -x / B;
                                                                                                                                    	} else {
                                                                                                                                    		tmp = (1.0 - x) / B;
                                                                                                                                    	}
                                                                                                                                    	return tmp;
                                                                                                                                    }
                                                                                                                                    
                                                                                                                                    def code(F, B, x):
                                                                                                                                    	tmp = 0
                                                                                                                                    	if F <= -3.8e-108:
                                                                                                                                    		tmp = (-1.0 - x) / B
                                                                                                                                    	elif F <= 6.4e-68:
                                                                                                                                    		tmp = -x / B
                                                                                                                                    	else:
                                                                                                                                    		tmp = (1.0 - x) / B
                                                                                                                                    	return tmp
                                                                                                                                    
                                                                                                                                    function code(F, B, x)
                                                                                                                                    	tmp = 0.0
                                                                                                                                    	if (F <= -3.8e-108)
                                                                                                                                    		tmp = Float64(Float64(-1.0 - x) / B);
                                                                                                                                    	elseif (F <= 6.4e-68)
                                                                                                                                    		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 <= -3.8e-108)
                                                                                                                                    		tmp = (-1.0 - x) / B;
                                                                                                                                    	elseif (F <= 6.4e-68)
                                                                                                                                    		tmp = -x / B;
                                                                                                                                    	else
                                                                                                                                    		tmp = (1.0 - x) / B;
                                                                                                                                    	end
                                                                                                                                    	tmp_2 = tmp;
                                                                                                                                    end
                                                                                                                                    
                                                                                                                                    code[F_, B_, x_] := If[LessEqual[F, -3.8e-108], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6.4e-68], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                                                                                    
                                                                                                                                    \begin{array}{l}
                                                                                                                                    
                                                                                                                                    \\
                                                                                                                                    \begin{array}{l}
                                                                                                                                    \mathbf{if}\;F \leq -3.8 \cdot 10^{-108}:\\
                                                                                                                                    \;\;\;\;\frac{-1 - x}{B}\\
                                                                                                                                    
                                                                                                                                    \mathbf{elif}\;F \leq 6.4 \cdot 10^{-68}:\\
                                                                                                                                    \;\;\;\;\frac{-x}{B}\\
                                                                                                                                    
                                                                                                                                    \mathbf{else}:\\
                                                                                                                                    \;\;\;\;\frac{1 - x}{B}\\
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    \end{array}
                                                                                                                                    \end{array}
                                                                                                                                    
                                                                                                                                    Derivation
                                                                                                                                    1. Split input into 3 regimes
                                                                                                                                    2. if F < -3.79999999999999973e-108

                                                                                                                                      1. Initial program 68.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.f6435.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 rewrites35.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 -inf

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

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

                                                                                                                                        if -3.79999999999999973e-108 < F < 6.3999999999999998e-68

                                                                                                                                        1. Initial program 99.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.f6453.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 rewrites53.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 0

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

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

                                                                                                                                          if 6.3999999999999998e-68 < F

                                                                                                                                          1. Initial program 70.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.f6443.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 rewrites43.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 inf

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

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

                                                                                                                                          Alternative 25: 36.3% accurate, 17.5× speedup?

                                                                                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-108}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                                                                                                          (FPCore (F B x)
                                                                                                                                           :precision binary64
                                                                                                                                           (if (<= F -3.8e-108) (/ (- -1.0 x) B) (/ (- x) B)))
                                                                                                                                          double code(double F, double B, double x) {
                                                                                                                                          	double tmp;
                                                                                                                                          	if (F <= -3.8e-108) {
                                                                                                                                          		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 <= (-3.8d-108)) 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 <= -3.8e-108) {
                                                                                                                                          		tmp = (-1.0 - x) / B;
                                                                                                                                          	} else {
                                                                                                                                          		tmp = -x / B;
                                                                                                                                          	}
                                                                                                                                          	return tmp;
                                                                                                                                          }
                                                                                                                                          
                                                                                                                                          def code(F, B, x):
                                                                                                                                          	tmp = 0
                                                                                                                                          	if F <= -3.8e-108:
                                                                                                                                          		tmp = (-1.0 - x) / B
                                                                                                                                          	else:
                                                                                                                                          		tmp = -x / B
                                                                                                                                          	return tmp
                                                                                                                                          
                                                                                                                                          function code(F, B, x)
                                                                                                                                          	tmp = 0.0
                                                                                                                                          	if (F <= -3.8e-108)
                                                                                                                                          		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 <= -3.8e-108)
                                                                                                                                          		tmp = (-1.0 - x) / B;
                                                                                                                                          	else
                                                                                                                                          		tmp = -x / B;
                                                                                                                                          	end
                                                                                                                                          	tmp_2 = tmp;
                                                                                                                                          end
                                                                                                                                          
                                                                                                                                          code[F_, B_, x_] := If[LessEqual[F, -3.8e-108], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                                                                                                          
                                                                                                                                          \begin{array}{l}
                                                                                                                                          
                                                                                                                                          \\
                                                                                                                                          \begin{array}{l}
                                                                                                                                          \mathbf{if}\;F \leq -3.8 \cdot 10^{-108}:\\
                                                                                                                                          \;\;\;\;\frac{-1 - x}{B}\\
                                                                                                                                          
                                                                                                                                          \mathbf{else}:\\
                                                                                                                                          \;\;\;\;\frac{-x}{B}\\
                                                                                                                                          
                                                                                                                                          
                                                                                                                                          \end{array}
                                                                                                                                          \end{array}
                                                                                                                                          
                                                                                                                                          Derivation
                                                                                                                                          1. Split input into 2 regimes
                                                                                                                                          2. if F < -3.79999999999999973e-108

                                                                                                                                            1. Initial program 68.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.f6435.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 rewrites35.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 -inf

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

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

                                                                                                                                              if -3.79999999999999973e-108 < F

                                                                                                                                              1. Initial program 86.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.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 rewrites29.9%

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

                                                                                                                                              Alternative 26: 29.5% 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 79.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.f6443.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 rewrites43.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 rewrites26.2%

                                                                                                                                                  \[\leadsto \frac{-x}{B} \]
                                                                                                                                                2. Add Preprocessing

                                                                                                                                                Alternative 27: 10.6% 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 79.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.f6443.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 rewrites43.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 -inf

                                                                                                                                                  \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                                                                                                                7. Step-by-step derivation
                                                                                                                                                  1. Applied rewrites25.6%

                                                                                                                                                    \[\leadsto \frac{-1 - x}{B} \]
                                                                                                                                                  2. Taylor expanded in x around 0

                                                                                                                                                    \[\leadsto \frac{-1}{B} \]
                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                    1. Applied rewrites9.6%

                                                                                                                                                      \[\leadsto \frac{-1}{B} \]
                                                                                                                                                    2. Add Preprocessing

                                                                                                                                                    Reproduce

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