VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.7% → 99.7%
Time: 13.6s
Alternatives: 21
Speedup: 1.6×

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 21 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.7% 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.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -6.1 \cdot 10^{+26}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 1000000000000:\\ \;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \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 -6.1e+26)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 1000000000000.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 <= -6.1e+26) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 1000000000000.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 <= -6.1e+26)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 1000000000000.0)
		tmp = Float64(Float64(F / Float64(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, -6.1e+26], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1000000000000.0], N[(N[(F / N[(N[Sqrt[N[(2.0 * x + 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 -6.1 \cdot 10^{+26}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq 1000000000000:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \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 < -6.1000000000000003e26

    1. Initial program 46.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 rewrites65.0%

      \[\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 rewrites65.1%

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

      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(x, 2, \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(x, 2, \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(x, 2, \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(x, 2, \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(x, 2, \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(x, 2, \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}{x \cdot 2 + \mathsf{fma}\left(F, F, 2\right)}}} - \frac{x}{\tan B} \]
        7. *-commutativeN/A

          \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{2 \cdot x} + \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(2, x, \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(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} - \frac{x}{\tan B} \]

      if 1e12 < F

      1. Initial program 61.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 rewrites84.0%

        \[\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 rewrites84.1%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \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} \]
      8. Recombined 3 regimes into one program.
      9. Final simplification99.7%

        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.1 \cdot 10^{+26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1000000000000:\\ \;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \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} \]
      10. Add Preprocessing

      Alternative 2: 78.6% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\tan B} \cdot x\\ t_1 := {\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}^{\left(\frac{-1}{2}\right)} \cdot \frac{F}{\sin B} - t\_0\\ t_2 := \frac{1}{\left(\mathsf{fma}\left(-0.16666666666666666, \frac{B \cdot B}{F}, \frac{1}{F}\right) \cdot \sqrt{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}\right) \cdot B} - t\_0\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+39}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 20:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F} \cdot \sin B} - \frac{x}{B}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (let* ((t_0 (* (/ 1.0 (tan B)) x))
              (t_1
               (-
                (* (pow (+ (* 2.0 x) (+ (* F F) 2.0)) (/ -1.0 2.0)) (/ F (sin B)))
                t_0))
              (t_2
               (-
                (/
                 1.0
                 (*
                  (*
                   (fma -0.16666666666666666 (/ (* B B) F) (/ 1.0 F))
                   (sqrt (+ (fma 2.0 x (* F F)) 2.0)))
                  B))
                t_0)))
         (if (<= t_1 -2e+39)
           t_2
           (if (<= t_1 20.0)
             (- (/ 1.0 (* (/ (sqrt (fma 2.0 x (fma F F 2.0))) F) (sin B))) (/ x B))
             (if (<= t_1 INFINITY) t_2 (/ (- -1.0 x) B))))))
      double code(double F, double B, double x) {
      	double t_0 = (1.0 / tan(B)) * x;
      	double t_1 = (pow(((2.0 * x) + ((F * F) + 2.0)), (-1.0 / 2.0)) * (F / sin(B))) - t_0;
      	double t_2 = (1.0 / ((fma(-0.16666666666666666, ((B * B) / F), (1.0 / F)) * sqrt((fma(2.0, x, (F * F)) + 2.0))) * B)) - t_0;
      	double tmp;
      	if (t_1 <= -2e+39) {
      		tmp = t_2;
      	} else if (t_1 <= 20.0) {
      		tmp = (1.0 / ((sqrt(fma(2.0, x, fma(F, F, 2.0))) / F) * sin(B))) - (x / B);
      	} else if (t_1 <= ((double) INFINITY)) {
      		tmp = t_2;
      	} else {
      		tmp = (-1.0 - x) / B;
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	t_0 = Float64(Float64(1.0 / tan(B)) * x)
      	t_1 = Float64(Float64((Float64(Float64(2.0 * x) + Float64(Float64(F * F) + 2.0)) ^ Float64(-1.0 / 2.0)) * Float64(F / sin(B))) - t_0)
      	t_2 = Float64(Float64(1.0 / Float64(Float64(fma(-0.16666666666666666, Float64(Float64(B * B) / F), Float64(1.0 / F)) * sqrt(Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * B)) - t_0)
      	tmp = 0.0
      	if (t_1 <= -2e+39)
      		tmp = t_2;
      	elseif (t_1 <= 20.0)
      		tmp = Float64(Float64(1.0 / Float64(Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) / F) * sin(B))) - Float64(x / B));
      	elseif (t_1 <= Inf)
      		tmp = t_2;
      	else
      		tmp = Float64(Float64(-1.0 - x) / B);
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(N[(2.0 * x), $MachinePrecision] + N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / N[(N[(N[(-0.16666666666666666 * N[(N[(B * B), $MachinePrecision] / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+39], t$95$2, If[LessEqual[t$95$1, 20.0], N[(N[(1.0 / N[(N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{1}{\tan B} \cdot x\\
      t_1 := {\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}^{\left(\frac{-1}{2}\right)} \cdot \frac{F}{\sin B} - t\_0\\
      t_2 := \frac{1}{\left(\mathsf{fma}\left(-0.16666666666666666, \frac{B \cdot B}{F}, \frac{1}{F}\right) \cdot \sqrt{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}\right) \cdot B} - t\_0\\
      \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+39}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;t\_1 \leq 20:\\
      \;\;\;\;\frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F} \cdot \sin B} - \frac{x}{B}\\
      
      \mathbf{elif}\;t\_1 \leq \infty:\\
      \;\;\;\;t\_2\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{-1 - x}{B}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -1.99999999999999988e39 or 20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < +inf.0

        1. Initial program 94.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} \]
          3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\frac{\sin B}{F}}{{\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}}} \]
          14. lower-fma.f6496.1

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.99999999999999988e39 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 20

        1. Initial program 78.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 rewrites78.1%

          \[\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 rewrites78.2%

          \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \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(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}} - \frac{x}{\tan B} \]
          2. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F} \cdot \sin B} - \color{blue}{\frac{x}{B}} \]
        9. Step-by-step derivation
          1. lower-/.f6455.8

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

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

        if +inf.0 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

        1. Initial program 0.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.f6458.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 rewrites58.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 -inf

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

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

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

        Alternative 3: 99.0% accurate, 1.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -14000:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B} - \frac{1}{\tan B} \cdot x\\ \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 -14000.0)
             (- (/ -1.0 (sin B)) t_0)
             (if (<= F 1.4)
               (- (* (sqrt 0.5) (/ F (sin B))) (* (/ 1.0 (tan B)) x))
               (- (/ 1.0 (sin B)) t_0)))))
        double code(double F, double B, double x) {
        	double t_0 = x / tan(B);
        	double tmp;
        	if (F <= -14000.0) {
        		tmp = (-1.0 / sin(B)) - t_0;
        	} else if (F <= 1.4) {
        		tmp = (sqrt(0.5) * (F / sin(B))) - ((1.0 / tan(B)) * x);
        	} else {
        		tmp = (1.0 / sin(B)) - t_0;
        	}
        	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) :: t_0
            real(8) :: tmp
            t_0 = x / tan(b)
            if (f <= (-14000.0d0)) then
                tmp = ((-1.0d0) / sin(b)) - t_0
            else if (f <= 1.4d0) then
                tmp = (sqrt(0.5d0) * (f / sin(b))) - ((1.0d0 / tan(b)) * x)
            else
                tmp = (1.0d0 / sin(b)) - t_0
            end if
            code = tmp
        end function
        
        public static double code(double F, double B, double x) {
        	double t_0 = x / Math.tan(B);
        	double tmp;
        	if (F <= -14000.0) {
        		tmp = (-1.0 / Math.sin(B)) - t_0;
        	} else if (F <= 1.4) {
        		tmp = (Math.sqrt(0.5) * (F / Math.sin(B))) - ((1.0 / Math.tan(B)) * x);
        	} else {
        		tmp = (1.0 / Math.sin(B)) - t_0;
        	}
        	return tmp;
        }
        
        def code(F, B, x):
        	t_0 = x / math.tan(B)
        	tmp = 0
        	if F <= -14000.0:
        		tmp = (-1.0 / math.sin(B)) - t_0
        	elif F <= 1.4:
        		tmp = (math.sqrt(0.5) * (F / math.sin(B))) - ((1.0 / math.tan(B)) * x)
        	else:
        		tmp = (1.0 / math.sin(B)) - t_0
        	return tmp
        
        function code(F, B, x)
        	t_0 = Float64(x / tan(B))
        	tmp = 0.0
        	if (F <= -14000.0)
        		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
        	elseif (F <= 1.4)
        		tmp = Float64(Float64(sqrt(0.5) * Float64(F / sin(B))) - Float64(Float64(1.0 / tan(B)) * x));
        	else
        		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
        	end
        	return tmp
        end
        
        function tmp_2 = code(F, B, x)
        	t_0 = x / tan(B);
        	tmp = 0.0;
        	if (F <= -14000.0)
        		tmp = (-1.0 / sin(B)) - t_0;
        	elseif (F <= 1.4)
        		tmp = (sqrt(0.5) * (F / sin(B))) - ((1.0 / tan(B)) * x);
        	else
        		tmp = (1.0 / sin(B)) - t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -14000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[Sqrt[0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $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 -14000:\\
        \;\;\;\;\frac{-1}{\sin B} - t\_0\\
        
        \mathbf{elif}\;F \leq 1.4:\\
        \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B} - \frac{1}{\tan B} \cdot x\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{1}{\sin B} - t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if F < -14000

          1. Initial program 49.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 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(x, 2, \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 -14000 < F < 1.3999999999999999

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{0.5} \]

              if 1.3999999999999999 < F

              1. Initial program 61.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 rewrites84.0%

                \[\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 rewrites84.1%

                \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \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} \]
              8. Recombined 3 regimes into one program.
              9. Final simplification98.8%

                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -14000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B} - \frac{1}{\tan B} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
              10. Add Preprocessing

              Alternative 4: 91.1% accurate, 1.5× speedup?

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

                1. Initial program 50.9%

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

                    \[\leadsto \color{blue}{\left(-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 rewrites68.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 rewrites68.3%

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

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

                  if -0.46000000000000002 < F < 4.10000000000000037e-226

                  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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} \]
                    3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\frac{\sin B}{F}}{{\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}}} \]
                    14. lower-fma.f6499.6

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 4.10000000000000037e-226 < F < 44000

                  1. Initial program 99.4%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Add Preprocessing
                  3. 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.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 rewrites99.2%

                    \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \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(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}} - \frac{x}{\tan B} \]
                    2. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F} \cdot \sin B} - \color{blue}{\frac{x}{B}} \]
                  9. Step-by-step derivation
                    1. lower-/.f6476.9

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

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

                  if 44000 < F

                  1. Initial program 61.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 rewrites84.0%

                    \[\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 rewrites84.1%

                    \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \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} \]
                  8. Recombined 4 regimes into one program.
                  9. Final simplification93.4%

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

                  Alternative 5: 84.6% accurate, 1.6× speedup?

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

                    1. Initial program 50.9%

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

                        \[\leadsto \color{blue}{\left(-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 rewrites68.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 rewrites68.3%

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

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

                      if -0.46000000000000002 < F < 4.10000000000000037e-226

                      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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} \]
                        3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\frac{\sin B}{F}}{{\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}}} \]
                        14. lower-fma.f6499.6

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 4.10000000000000037e-226 < F < 3.89999999999999984e51

                      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.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 rewrites99.3%

                        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \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(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}} - \frac{x}{\tan B} \]
                        2. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F} \cdot \sin B} - \color{blue}{\frac{x}{B}} \]
                      9. Step-by-step derivation
                        1. lower-/.f6481.5

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

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

                      if 3.89999999999999984e51 < F

                      1. Initial program 54.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 rewrites81.0%

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

                        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \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} \]
                        2. Taylor expanded in B around 0

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

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

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

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

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

                            \[\leadsto \frac{1}{\mathsf{fma}\left(\frac{-1}{6}, \color{blue}{B \cdot B}, 1\right) \cdot B} - \frac{x}{\tan B} \]
                          6. lower-*.f6483.3

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

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

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

                      Alternative 6: 76.3% accurate, 2.1× speedup?

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

                        1. Initial program 78.7%

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

                            \[\leadsto \color{blue}{\left(-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 rewrites96.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. 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 rewrites92.5%

                            \[\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-/.f6494.8

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

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

                          if -1.25000000000000007e-33 < x < 0.77000000000000002

                          1. Initial program 73.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 rewrites77.9%

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

                            \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \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(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}} - \frac{x}{\tan B} \]
                            2. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F} \cdot \sin B} - \color{blue}{\frac{x}{B}} \]
                          9. Step-by-step derivation
                            1. lower-/.f6467.3

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

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

                        Alternative 7: 76.3% accurate, 2.2× speedup?

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

                          1. Initial program 78.7%

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

                              \[\leadsto \color{blue}{\left(-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 rewrites96.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. 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 rewrites92.5%

                              \[\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-/.f6494.8

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

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

                            if -1.25000000000000007e-33 < x < 0.77000000000000002

                            1. Initial program 73.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 rewrites77.9%

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

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

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

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

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

                          Alternative 8: 57.2% accurate, 2.3× speedup?

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

                            1. Initial program 74.8%

                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            2. Add Preprocessing
                            3. Taylor expanded in 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) + \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right) + \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right)\right)\right) - x}{B}} \]
                            4. Applied rewrites58.1%

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

                            if 0.40000000000000002 < B

                            1. Initial program 80.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 rewrites79.9%

                              \[\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 rewrites79.9%

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

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

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

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

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

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

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

                                  \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}, {B}^{2}, 1\right)} \cdot B} - \frac{x}{\tan B} \]
                                6. sub-negN/A

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

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

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

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

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

                                  \[\leadsto \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{120}, B \cdot B, \frac{-1}{6}\right), \color{blue}{B \cdot B}, 1\right) \cdot B} - \frac{x}{\tan B} \]
                                12. lower-*.f6449.6

                                  \[\leadsto \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, B \cdot B, -0.16666666666666666\right), \color{blue}{B \cdot B}, 1\right) \cdot B} - \frac{x}{\tan B} \]
                              4. Applied rewrites49.6%

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 0.4:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \left(-F\right) \cdot \mathsf{fma}\left(-0.019444444444444445, B \cdot B, -0.16666666666666666\right), \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right) \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, B \cdot B, -0.16666666666666666\right), B \cdot B, 1\right) \cdot B} - \frac{x}{\tan B}\\ \end{array} \]
                            10. Add Preprocessing

                            Alternative 9: 57.1% accurate, 2.5× speedup?

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

                              1. Initial program 74.8%

                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                              2. Add Preprocessing
                              3. Taylor expanded in 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) + \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right) + \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right)\right)\right) - x}{B}} \]
                              4. Applied rewrites58.1%

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

                              if 0.40000000000000002 < B

                              1. Initial program 80.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 rewrites79.9%

                                \[\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 rewrites79.9%

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

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

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

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

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

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

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

                                    \[\leadsto \frac{1}{\mathsf{fma}\left(\frac{-1}{6}, \color{blue}{B \cdot B}, 1\right) \cdot B} - \frac{x}{\tan B} \]
                                  6. lower-*.f6449.4

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

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

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

                              Alternative 10: 56.5% accurate, 2.6× speedup?

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

                                1. Initial program 74.8%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Add Preprocessing
                                3. Taylor expanded in 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) + \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right) + \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right)\right)\right) - x}{B}} \]
                                4. Applied rewrites58.1%

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

                                if 0.40000000000000002 < B

                                1. Initial program 80.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 rewrites79.9%

                                  \[\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 rewrites46.6%

                                    \[\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-/.f6444.7

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

                                    \[\leadsto \mathsf{fma}\left(-1, \color{blue}{\frac{-1}{B}}, \frac{-x}{\tan B}\right) \]
                                7. Recombined 2 regimes into one program.
                                8. Final simplification55.3%

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

                                Alternative 11: 59.4% accurate, 2.7× speedup?

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

                                  1. Initial program 21.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.f6429.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 rewrites29.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 rewrites53.0%

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

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

                                      if -5.2e148 < F < 520

                                      1. Initial program 98.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{\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) + \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right) + \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right)\right)\right) - x}{B}} \]
                                      4. Applied rewrites53.0%

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

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

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

                                        if 520 < F

                                        1. Initial program 61.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 rewrites84.0%

                                          \[\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 rewrites84.1%

                                          \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \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} \]
                                          2. Taylor expanded in B around 0

                                            \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f6474.8

                                              \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                          4. Applied rewrites74.8%

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

                                        Alternative 12: 56.5% accurate, 2.7× speedup?

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

                                          1. Initial program 74.8%

                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          2. Add Preprocessing
                                          3. Taylor expanded in 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 rewrites65.2%

                                            \[\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(F \cdot \left(B \cdot B\right), 0.16666666666666666, F\right)}{B}} \]
                                          6. Taylor expanded in B around 0

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

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

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

                                          if 0.40000000000000002 < B

                                          1. Initial program 80.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 rewrites79.9%

                                            \[\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 rewrites46.6%

                                              \[\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-/.f6444.7

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

                                              \[\leadsto \mathsf{fma}\left(-1, \color{blue}{\frac{-1}{B}}, \frac{-x}{\tan B}\right) \]
                                          7. Recombined 2 regimes into one program.
                                          8. Final simplification55.2%

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

                                          Alternative 13: 52.4% accurate, 2.9× speedup?

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

                                            1. Initial program 21.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.f6429.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 rewrites29.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 rewrites53.0%

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

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

                                                if -5.2e148 < F < 1.3e128

                                                1. Initial program 96.8%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in 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) + \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right) + \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right)\right)\right) - x}{B}} \]
                                                4. Applied rewrites51.1%

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

                                                  \[\leadsto \frac{\mathsf{fma}\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, B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)\right)}{B} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites51.5%

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

                                                  if 1.3e128 < F

                                                  1. Initial program 41.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    13. lower-neg.f6444.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 rewrites44.6%

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

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

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

                                                  Alternative 14: 52.3% accurate, 3.8× speedup?

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

                                                    1. Initial program 40.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.f6434.5

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

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

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

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

                                                      if -4.70000000000000017e67 < F < 1.25e128

                                                      1. Initial program 97.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{\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 rewrites51.6%

                                                        \[\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(F \cdot \left(B \cdot B\right), 0.16666666666666666, F\right), \mathsf{fma}\left(0.3333333333333333, \left(B \cdot B\right) \cdot x, -x\right)\right)}{B}} \]

                                                      if 1.25e128 < F

                                                      1. Initial program 41.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        13. lower-neg.f6444.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 rewrites44.6%

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

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

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

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

                                                      Alternative 15: 52.4% accurate, 4.0× speedup?

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

                                                        1. Initial program 50.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.f6440.5

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

                                                          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                        6. 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 rewrites54.8%

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

                                                          if -13500 < F < 1.0199999999999999e89

                                                          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 \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 rewrites62.8%

                                                            \[\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(F \cdot \left(B \cdot B\right), 0.16666666666666666, F\right)}{B}} \]
                                                          6. Taylor expanded in B around 0

                                                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(F \cdot \left(B \cdot B\right), \frac{1}{6}, F\right)}{B} \]
                                                          7. Step-by-step derivation
                                                            1. lower-/.f6449.7

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

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

                                                          if 1.0199999999999999e89 < F

                                                          1. Initial program 44.8%

                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in 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.f6446.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 rewrites46.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 rewrites59.7%

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

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

                                                          Alternative 16: 52.4% accurate, 5.2× speedup?

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

                                                            1. Initial program 17.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.f6425.9

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

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

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

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

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

                                                                if -5.0000000000000002e160 < F < 1e8

                                                                1. Initial program 96.4%

                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                2. Add Preprocessing
                                                                3. Taylor expanded in 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.f6452.9

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

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

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

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

                                                                    if 1e8 < F

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

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

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

                                                                    Alternative 17: 52.4% accurate, 6.8× speedup?

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

                                                                      1. Initial program 17.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.f6425.9

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

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

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

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

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

                                                                          if -5.0000000000000002e160 < F < 1e8

                                                                          1. Initial program 96.4%

                                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                          2. Add Preprocessing
                                                                          3. Taylor expanded in 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.f6452.9

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

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

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

                                                                              \[\leadsto \frac{\frac{F}{\sqrt{2 + {F}^{2}}} - x}{B} \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites53.0%

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

                                                                              if 1e8 < F

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

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

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

                                                                              Alternative 18: 44.7% accurate, 13.6× speedup?

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

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

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

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

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

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

                                                                                  if -1.2000000000000001e-52 < F < 3.1e-82

                                                                                  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.f6451.1

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

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

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

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

                                                                                    if 3.1e-82 < F

                                                                                    1. Initial program 70.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.f6443.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 rewrites43.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 - x}{B} \]
                                                                                    7. Step-by-step derivation
                                                                                      1. Applied rewrites45.7%

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

                                                                                    Alternative 19: 32.1% accurate, 14.1× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{B}\\ \mathbf{if}\;x \leq -1.24 \cdot 10^{-154}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-187}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                                    (FPCore (F B x)
                                                                                     :precision binary64
                                                                                     (let* ((t_0 (/ (- x) B)))
                                                                                       (if (<= x -1.24e-154) t_0 (if (<= x 2.7e-187) (/ -1.0 B) t_0))))
                                                                                    double code(double F, double B, double x) {
                                                                                    	double t_0 = -x / B;
                                                                                    	double tmp;
                                                                                    	if (x <= -1.24e-154) {
                                                                                    		tmp = t_0;
                                                                                    	} else if (x <= 2.7e-187) {
                                                                                    		tmp = -1.0 / B;
                                                                                    	} else {
                                                                                    		tmp = t_0;
                                                                                    	}
                                                                                    	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) :: t_0
                                                                                        real(8) :: tmp
                                                                                        t_0 = -x / b
                                                                                        if (x <= (-1.24d-154)) then
                                                                                            tmp = t_0
                                                                                        else if (x <= 2.7d-187) then
                                                                                            tmp = (-1.0d0) / b
                                                                                        else
                                                                                            tmp = t_0
                                                                                        end if
                                                                                        code = tmp
                                                                                    end function
                                                                                    
                                                                                    public static double code(double F, double B, double x) {
                                                                                    	double t_0 = -x / B;
                                                                                    	double tmp;
                                                                                    	if (x <= -1.24e-154) {
                                                                                    		tmp = t_0;
                                                                                    	} else if (x <= 2.7e-187) {
                                                                                    		tmp = -1.0 / B;
                                                                                    	} else {
                                                                                    		tmp = t_0;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    def code(F, B, x):
                                                                                    	t_0 = -x / B
                                                                                    	tmp = 0
                                                                                    	if x <= -1.24e-154:
                                                                                    		tmp = t_0
                                                                                    	elif x <= 2.7e-187:
                                                                                    		tmp = -1.0 / B
                                                                                    	else:
                                                                                    		tmp = t_0
                                                                                    	return tmp
                                                                                    
                                                                                    function code(F, B, x)
                                                                                    	t_0 = Float64(Float64(-x) / B)
                                                                                    	tmp = 0.0
                                                                                    	if (x <= -1.24e-154)
                                                                                    		tmp = t_0;
                                                                                    	elseif (x <= 2.7e-187)
                                                                                    		tmp = Float64(-1.0 / B);
                                                                                    	else
                                                                                    		tmp = t_0;
                                                                                    	end
                                                                                    	return tmp
                                                                                    end
                                                                                    
                                                                                    function tmp_2 = code(F, B, x)
                                                                                    	t_0 = -x / B;
                                                                                    	tmp = 0.0;
                                                                                    	if (x <= -1.24e-154)
                                                                                    		tmp = t_0;
                                                                                    	elseif (x <= 2.7e-187)
                                                                                    		tmp = -1.0 / B;
                                                                                    	else
                                                                                    		tmp = t_0;
                                                                                    	end
                                                                                    	tmp_2 = tmp;
                                                                                    end
                                                                                    
                                                                                    code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[x, -1.24e-154], t$95$0, If[LessEqual[x, 2.7e-187], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    t_0 := \frac{-x}{B}\\
                                                                                    \mathbf{if}\;x \leq -1.24 \cdot 10^{-154}:\\
                                                                                    \;\;\;\;t\_0\\
                                                                                    
                                                                                    \mathbf{elif}\;x \leq 2.7 \cdot 10^{-187}:\\
                                                                                    \;\;\;\;\frac{-1}{B}\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;t\_0\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 2 regimes
                                                                                    2. if x < -1.24e-154 or 2.7000000000000001e-187 < x

                                                                                      1. Initial program 78.4%

                                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in 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.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 rewrites48.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.1%

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

                                                                                        if -1.24e-154 < x < 2.7000000000000001e-187

                                                                                        1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \frac{-1}{B} \]
                                                                                          4. Recombined 2 regimes into one program.
                                                                                          5. Add Preprocessing

                                                                                          Alternative 20: 37.8% accurate, 17.5× speedup?

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

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

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

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

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

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

                                                                                              if -1.2000000000000001e-52 < F

                                                                                              1. Initial program 85.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.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 rewrites33.5%

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

                                                                                              Alternative 21: 11.1% accurate, 30.7× speedup?

                                                                                              \[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
                                                                                              (FPCore (F B x) :precision binary64 (/ -1.0 B))
                                                                                              double code(double F, double B, double x) {
                                                                                              	return -1.0 / B;
                                                                                              }
                                                                                              
                                                                                              real(8) function code(f, b, x)
                                                                                                  real(8), intent (in) :: f
                                                                                                  real(8), intent (in) :: b
                                                                                                  real(8), intent (in) :: x
                                                                                                  code = (-1.0d0) / b
                                                                                              end function
                                                                                              
                                                                                              public static double code(double F, double B, double x) {
                                                                                              	return -1.0 / B;
                                                                                              }
                                                                                              
                                                                                              def code(F, B, x):
                                                                                              	return -1.0 / B
                                                                                              
                                                                                              function code(F, B, x)
                                                                                              	return Float64(-1.0 / B)
                                                                                              end
                                                                                              
                                                                                              function tmp = code(F, B, x)
                                                                                              	tmp = -1.0 / B;
                                                                                              end
                                                                                              
                                                                                              code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
                                                                                              
                                                                                              \begin{array}{l}
                                                                                              
                                                                                              \\
                                                                                              \frac{-1}{B}
                                                                                              \end{array}
                                                                                              
                                                                                              Derivation
                                                                                              1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                                13. lower-neg.f6446.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 rewrites46.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 rewrites32.5%

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

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

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

                                                                                                  Reproduce

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