VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.2% → 99.7%
Time: 12.3s
Alternatives: 21
Speedup: 1.4×

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: 77.2% 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 -7000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 120000000:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - 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 -7000000000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 120000000.0)
       (- (/ F (* (sin B) (sqrt (fma x 2.0 (fma F F 2.0))))) 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 <= -7000000000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 120000000.0) {
		tmp = (F / (sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - 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 <= -7000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 120000000.0)
		tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - 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, -7000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 120000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $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 -7000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

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

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


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

    1. Initial program 70.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. frac-2negN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
      6. div-invN/A

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

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

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

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

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

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

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

      if -7e9 < F < 1.2e8

      1. Initial program 99.5%

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
        6. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.2e8 < F

      1. Initial program 52.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. frac-2negN/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
        6. div-invN/A

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

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

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

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

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

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

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

      Alternative 2: 76.5% accurate, 0.3× speedup?

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

        1. Initial program 95.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. frac-2negN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
          6. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -15 < (+.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)))))) < 5

        1. Initial program 76.3%

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

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \cdot \frac{F}{\sin B} \]
          4. lower-/.f64N/A

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

            \[\leadsto \sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}} \cdot \frac{F}{\sin B} \]
          6. unpow2N/A

            \[\leadsto \sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{F}{\sin B} \]
          7. lower-fma.f64N/A

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

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

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

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

        if 5 < (+.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.00000000000000003e257

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.00000000000000003e257 < (+.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 35.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
        8. Recombined 4 regimes into one program.
        9. Final simplification81.7%

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

        Alternative 3: 75.4% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := \frac{\frac{F}{B}}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\ t_2 := \frac{F}{\sin B}\\ t_3 := t\_0 + t\_2 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\ \mathbf{if}\;t\_3 \leq -15:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq 5:\\ \;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot t\_2\\ \mathbf{elif}\;t\_3 \leq 10^{+257}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0 + {B}^{-1}\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (let* ((t_0 (* x (/ -1.0 (tan B))))
                (t_1 (- (/ (/ F B) (sqrt (fma x 2.0 (fma F F 2.0)))) (/ x (tan B))))
                (t_2 (/ F (sin B)))
                (t_3 (+ t_0 (* t_2 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))))
           (if (<= t_3 -15.0)
             t_1
             (if (<= t_3 5.0)
               (* (sqrt (pow (fma F F 2.0) -1.0)) t_2)
               (if (<= t_3 1e+257) t_1 (+ t_0 (pow B -1.0)))))))
        double code(double F, double B, double x) {
        	double t_0 = x * (-1.0 / tan(B));
        	double t_1 = ((F / B) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - (x / tan(B));
        	double t_2 = F / sin(B);
        	double t_3 = t_0 + (t_2 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
        	double tmp;
        	if (t_3 <= -15.0) {
        		tmp = t_1;
        	} else if (t_3 <= 5.0) {
        		tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * t_2;
        	} else if (t_3 <= 1e+257) {
        		tmp = t_1;
        	} else {
        		tmp = t_0 + pow(B, -1.0);
        	}
        	return tmp;
        }
        
        function code(F, B, x)
        	t_0 = Float64(x * Float64(-1.0 / tan(B)))
        	t_1 = Float64(Float64(Float64(F / B) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - Float64(x / tan(B)))
        	t_2 = Float64(F / sin(B))
        	t_3 = Float64(t_0 + Float64(t_2 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0))))
        	tmp = 0.0
        	if (t_3 <= -15.0)
        		tmp = t_1;
        	elseif (t_3 <= 5.0)
        		tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * t_2);
        	elseif (t_3 <= 1e+257)
        		tmp = t_1;
        	else
        		tmp = Float64(t_0 + (B ^ -1.0));
        	end
        	return tmp
        end
        
        code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(F / B), $MachinePrecision] / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 + N[(t$95$2 * 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]}, If[LessEqual[t$95$3, -15.0], t$95$1, If[LessEqual[t$95$3, 5.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 1e+257], t$95$1, N[(t$95$0 + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := x \cdot \frac{-1}{\tan B}\\
        t_1 := \frac{\frac{F}{B}}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
        t_2 := \frac{F}{\sin B}\\
        t_3 := t\_0 + t\_2 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
        \mathbf{if}\;t\_3 \leq -15:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t\_3 \leq 5:\\
        \;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot t\_2\\
        
        \mathbf{elif}\;t\_3 \leq 10^{+257}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0 + {B}^{-1}\\
        
        
        \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)))))) < -15 or 5 < (+.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.00000000000000003e257

          1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -15 < (+.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)))))) < 5

          1. Initial program 76.3%

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

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
            3. lower-sqrt.f64N/A

              \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \cdot \frac{F}{\sin B} \]
            4. lower-/.f64N/A

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

              \[\leadsto \sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}} \cdot \frac{F}{\sin B} \]
            6. unpow2N/A

              \[\leadsto \sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{F}{\sin B} \]
            7. lower-fma.f64N/A

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

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

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

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

          if 1.00000000000000003e257 < (+.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 35.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification80.6%

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

          Alternative 4: 56.1% accurate, 1.1× speedup?

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

            1. Initial program 77.6%

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

              \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \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 + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{5040} \cdot F + \left(\frac{1}{720} \cdot F + \frac{1}{6} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right)\right)\right) + \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right)\right)\right)\right) - x}{B}} \]
            4. Applied rewrites61.3%

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

              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(B \cdot B, \frac{1}{6}, 1\right), \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \left(\frac{7}{360} \cdot F - \frac{-31}{15120} \cdot \left({B}^{2} \cdot F\right)\right), B \cdot B, \frac{1}{3} \cdot x\right), B \cdot B, -x\right)\right)}{B} \]
            6. Step-by-step derivation
              1. Applied rewrites61.4%

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

              if 0.330000000000000016 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{F}} \]
              8. Recombined 2 regimes into one program.
              9. Final simplification60.1%

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

              Alternative 5: 55.5% accurate, 1.1× speedup?

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

                1. Initial program 77.6%

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

                  \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \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 + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{5040} \cdot F + \left(\frac{1}{720} \cdot F + \frac{1}{6} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right)\right)\right) + \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right)\right)\right)\right) - x}{B}} \]
                4. Applied rewrites61.3%

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

                  \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(B \cdot B, \frac{1}{6}, 1\right), \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F, \mathsf{fma}\left(\mathsf{fma}\left(\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \left(\frac{7}{360} \cdot F - \frac{-31}{15120} \cdot \left({B}^{2} \cdot F\right)\right), B \cdot B, \frac{1}{3} \cdot x\right), B \cdot B, -x\right)\right)}{B} \]
                6. Step-by-step derivation
                  1. Applied rewrites61.4%

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

                  if 0.330000000000000016 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification60.1%

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

                  Alternative 6: 55.5% accurate, 1.1× speedup?

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

                    1. Initial program 77.6%

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

                      \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \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 rewrites61.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)}}, \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.019444444444444445, 0.16666666666666666 \cdot F\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.330000000000000016 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification59.9%

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

                    Alternative 7: 55.8% accurate, 1.2× speedup?

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

                      1. Initial program 77.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. frac-2negN/A

                          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
                        6. div-invN/A

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

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

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

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

                        \[\leadsto \color{blue}{\frac{-1 \cdot x + \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)}{B}} \]
                      6. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x\right)\right)} + \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)}{B} \]
                        2. +-commutativeN/A

                          \[\leadsto \frac{\color{blue}{\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) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                        3. sub-negN/A

                          \[\leadsto \frac{\color{blue}{\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. 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}} \]
                      7. Applied rewrites61.5%

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

                      if 0.19600000000000001 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification60.2%

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

                      Alternative 8: 90.2% accurate, 1.3× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.85 \cdot 10^{-18}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{-59}:\\ \;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 47000:\\ \;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
                      (FPCore (F B x)
                       :precision binary64
                       (let* ((t_0 (/ x (tan B))))
                         (if (<= F -1.85e-18)
                           (- (/ -1.0 (sin B)) t_0)
                           (if (<= F -2.5e-59)
                             (* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))
                             (if (<= F 47000.0)
                               (fma
                                (- F)
                                (/ (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (- B))
                                (/ (- x) (tan 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 <= -1.85e-18) {
                      		tmp = (-1.0 / sin(B)) - t_0;
                      	} else if (F <= -2.5e-59) {
                      		tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
                      	} else if (F <= 47000.0) {
                      		tmp = fma(-F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) / -B), (-x / tan(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 <= -1.85e-18)
                      		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
                      	elseif (F <= -2.5e-59)
                      		tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B)));
                      	elseif (F <= 47000.0)
                      		tmp = fma(Float64(-F), Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(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, -1.85e-18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.5e-59], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 47000.0], N[((-F) * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $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 -1.85 \cdot 10^{-18}:\\
                      \;\;\;\;\frac{-1}{\sin B} - t\_0\\
                      
                      \mathbf{elif}\;F \leq -2.5 \cdot 10^{-59}:\\
                      \;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
                      
                      \mathbf{elif}\;F \leq 47000:\\
                      \;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{1}{\sin B} - t\_0\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if F < -1.8500000000000002e-18

                        1. Initial program 72.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. frac-2negN/A

                            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
                          6. div-invN/A

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

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

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

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

                          \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
                        6. Taylor expanded in F around -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 -1.8500000000000002e-18 < F < -2.5000000000000001e-59

                          1. Initial program 99.3%

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

                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                          4. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
                            3. lower-sqrt.f64N/A

                              \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \cdot \frac{F}{\sin B} \]
                            4. lower-/.f64N/A

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

                              \[\leadsto \sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}} \cdot \frac{F}{\sin B} \]
                            6. unpow2N/A

                              \[\leadsto \sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{F}{\sin B} \]
                            7. lower-fma.f64N/A

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

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

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

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

                          if -2.5000000000000001e-59 < F < 47000

                          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. frac-2negN/A

                              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
                            6. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 47000 < F

                          1. Initial program 52.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. frac-2negN/A

                              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
                            6. div-invN/A

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

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

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

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

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

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

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

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

                          Alternative 9: 83.2% accurate, 1.3× speedup?

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

                            1. Initial program 72.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. frac-2negN/A

                                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
                              6. div-invN/A

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

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

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

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

                              \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
                            6. Taylor expanded in F around -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 -1.8500000000000002e-18 < F < -2.5000000000000001e-59 or 2.4000000000000001e-11 < F < 4.49999999999999995e30

                              1. Initial program 99.1%

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

                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                              4. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
                                2. lower-*.f64N/A

                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
                                3. lower-sqrt.f64N/A

                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \cdot \frac{F}{\sin B} \]
                                4. lower-/.f64N/A

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

                                  \[\leadsto \sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}} \cdot \frac{F}{\sin B} \]
                                6. unpow2N/A

                                  \[\leadsto \sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{F}{\sin B} \]
                                7. lower-fma.f64N/A

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

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

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

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

                              if -2.5000000000000001e-59 < F < 2.4000000000000001e-11

                              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. frac-2negN/A

                                  \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
                                6. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 4.49999999999999995e30 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
                              8. Recombined 4 regimes into one program.
                              9. Final simplification87.8%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.85 \cdot 10^{-18}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{-59}:\\ \;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-11}:\\ \;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{+30}:\\ \;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + {B}^{-1}\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 10: 90.7% accurate, 1.3× speedup?

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

                                1. Initial program 72.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. frac-2negN/A

                                    \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
                                  6. div-invN/A

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

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

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

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

                                  \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
                                6. Taylor expanded in F around -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 -1.8500000000000002e-18 < F < -4.1999999999999998e-116

                                  1. Initial program 99.2%

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

                                      \[\leadsto \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. 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)} \]
                                    3. associate-*l/N/A

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

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

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

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

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

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

                                  if -4.1999999999999998e-116 < F < 47000

                                  1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 47000 < F

                                  1. Initial program 52.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. frac-2negN/A

                                      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(F\right)}{\mathsf{neg}\left(\sin B\right)}} \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) \]
                                    6. div-invN/A

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

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

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

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

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

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

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

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

                                  Alternative 11: 49.8% accurate, 2.3× speedup?

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

                                    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{\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 + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{5040} \cdot F + \left(\frac{1}{720} \cdot F + \frac{1}{6} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right)\right)\right) + \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right)\right)\right)\right) - x}{B}} \]
                                    4. Applied rewrites45.7%

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

                                      \[\leadsto \frac{\left(-1 \cdot \left(1 + \frac{1}{6} \cdot {B}^{2}\right) + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{7}{360} + \frac{31}{15120} \cdot {B}^{2}\right) + \left(\frac{2}{945} \cdot \left({B}^{2} \cdot x\right) + \frac{1}{45} \cdot x\right)\right)\right)\right) - x}{B} \]
                                    6. Applied rewrites56.0%

                                      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, B \cdot B, 0.022222222222222223\right), x, -\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)\right) - x}{B} \]
                                    7. Taylor expanded in B around 0

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

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

                                      if -2.3e11 < F < 1.4199999999999999

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

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

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

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

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

                                        if 1.4199999999999999 < F

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

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

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

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

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

                                              \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                                          4. Recombined 3 regimes into one program.
                                          5. Final simplification53.3%

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

                                          Alternative 12: 50.1% accurate, 2.4× speedup?

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

                                            1. Initial program 66.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{\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 + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{5040} \cdot F + \left(\frac{1}{720} \cdot F + \frac{1}{6} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right)\right)\right) + \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right)\right)\right)\right) - x}{B}} \]
                                            4. Applied rewrites47.4%

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

                                              \[\leadsto \frac{\left(-1 \cdot \left(1 + \frac{1}{6} \cdot {B}^{2}\right) + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{7}{360} + \frac{31}{15120} \cdot {B}^{2}\right) + \left(\frac{2}{945} \cdot \left({B}^{2} \cdot x\right) + \frac{1}{45} \cdot x\right)\right)\right)\right) - x}{B} \]
                                            6. Applied rewrites59.4%

                                              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, B \cdot B, 0.022222222222222223\right), x, -\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)\right) - x}{B} \]
                                            7. Taylor expanded in x around 0

                                              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(-1 \cdot \left(\frac{7}{360} + \frac{31}{15120} \cdot {B}^{2}\right), B \cdot B, \frac{1}{3} \cdot x\right), B \cdot B, -\mathsf{fma}\left(\frac{1}{6}, B \cdot B, 1\right)\right) - x}{B} \]
                                            8. Step-by-step derivation
                                              1. Applied rewrites59.8%

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

                                              if -6.8e44 < F < 1.8e34

                                              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.f6450.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 rewrites50.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}} \]

                                              if 1.8e34 < F

                                              1. Initial program 49.9%

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

                                                \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \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 + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{5040} \cdot F + \left(\frac{1}{720} \cdot F + \frac{1}{6} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right)\right)\right) + \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right)\right)\right)\right) - x}{B}} \]
                                              4. Applied rewrites40.0%

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

                                                \[\leadsto \frac{\left(1 + \left(\frac{1}{6} \cdot {B}^{2} + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\left(\frac{7}{360} + \left(\frac{2}{945} \cdot \left({B}^{2} \cdot x\right) + \frac{1}{45} \cdot x\right)\right) - \frac{-31}{15120} \cdot {B}^{2}\right)\right)\right)\right) - x}{B} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites53.7%

                                                  \[\leadsto \frac{\left(\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right) + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, B \cdot B, 0.022222222222222223\right), x, 0.019444444444444445\right) - -0.00205026455026455 \cdot \left(B \cdot B\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right)\right) - x}{B} \]
                                              7. Recombined 3 regimes into one program.
                                              8. Final simplification53.4%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{+44}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(-\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)\right) - x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+34}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right) + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, B \cdot B, 0.022222222222222223\right), x, 0.019444444444444445\right) - -0.00205026455026455 \cdot \left(B \cdot B\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right)\right) - x}{B}\\ \end{array} \]
                                              9. Add Preprocessing

                                              Alternative 13: 50.2% accurate, 2.4× speedup?

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

                                                1. Initial program 66.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{\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 + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{5040} \cdot F + \left(\frac{1}{720} \cdot F + \frac{1}{6} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right)\right)\right) + \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right)\right)\right)\right) - x}{B}} \]
                                                4. Applied rewrites47.4%

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

                                                  \[\leadsto \frac{\left(-1 \cdot \left(1 + \frac{1}{6} \cdot {B}^{2}\right) + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{7}{360} + \frac{31}{15120} \cdot {B}^{2}\right) + \left(\frac{2}{945} \cdot \left({B}^{2} \cdot x\right) + \frac{1}{45} \cdot x\right)\right)\right)\right) - x}{B} \]
                                                6. Applied rewrites59.4%

                                                  \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, B \cdot B, 0.022222222222222223\right), x, -\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)\right) - x}{B} \]
                                                7. Taylor expanded in x around 0

                                                  \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(-1 \cdot \left(\frac{7}{360} + \frac{31}{15120} \cdot {B}^{2}\right), B \cdot B, \frac{1}{3} \cdot x\right), B \cdot B, -\mathsf{fma}\left(\frac{1}{6}, B \cdot B, 1\right)\right) - x}{B} \]
                                                8. Step-by-step derivation
                                                  1. Applied rewrites59.8%

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

                                                  if -6.8e44 < F < 5e4

                                                  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.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 rewrites51.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}} \]

                                                  if 5e4 < F

                                                  1. Initial program 52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    13. lower-neg.f6439.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 rewrites39.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 - x}{B} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites52.4%

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

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

                                                  Alternative 14: 50.2% accurate, 2.4× speedup?

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

                                                    1. Initial program 64.1%

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

                                                      \[\leadsto \color{blue}{\frac{\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 + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{5040} \cdot F + \left(\frac{1}{720} \cdot F + \frac{1}{6} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right)\right)\right) + \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right)\right)\right)\right) - x}{B}} \]
                                                    4. Applied rewrites48.1%

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

                                                      \[\leadsto \frac{\left(-1 \cdot \left(1 + \frac{1}{6} \cdot {B}^{2}\right) + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{7}{360} + \frac{31}{15120} \cdot {B}^{2}\right) + \left(\frac{2}{945} \cdot \left({B}^{2} \cdot x\right) + \frac{1}{45} \cdot x\right)\right)\right)\right) - x}{B} \]
                                                    6. Applied rewrites60.7%

                                                      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, B \cdot B, 0.022222222222222223\right), x, -\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)\right) - x}{B} \]
                                                    7. Taylor expanded in B around 0

                                                      \[\leadsto \frac{\left({B}^{2} \cdot \left(\left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\left(\frac{1}{45} \cdot x + {B}^{2} \cdot \left(\frac{2}{945} \cdot x - \frac{31}{15120}\right)\right) - \frac{7}{360}\right)\right) - \frac{1}{6}\right) - 1\right) - x}{B} \]
                                                    8. Step-by-step derivation
                                                      1. Applied rewrites61.0%

                                                        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, \mathsf{fma}\left(\mathsf{fma}\left(0.022222222222222223, x, \mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, x, -0.00205026455026455\right), B \cdot B, -0.019444444444444445\right)\right), B \cdot B, -0.16666666666666666\right)\right), B \cdot B, -1\right) - x}{B} \]

                                                      if -4.49999999999999959e59 < F < 5e4

                                                      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.f6450.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 rewrites50.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}} \]

                                                      if 5e4 < F

                                                      1. Initial program 52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        13. lower-neg.f6439.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 rewrites39.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 - x}{B} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites52.4%

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

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

                                                      Alternative 15: 49.8% accurate, 2.5× speedup?

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

                                                        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{\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 + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{5040} \cdot F + \left(\frac{1}{720} \cdot F + \frac{1}{6} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right)\right)\right) + \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right)\right)\right)\right) - x}{B}} \]
                                                        4. Applied rewrites45.7%

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

                                                          \[\leadsto \frac{\left(-1 \cdot \left(1 + \frac{1}{6} \cdot {B}^{2}\right) + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{7}{360} + \frac{31}{15120} \cdot {B}^{2}\right) + \left(\frac{2}{945} \cdot \left({B}^{2} \cdot x\right) + \frac{1}{45} \cdot x\right)\right)\right)\right) - x}{B} \]
                                                        6. Applied rewrites56.0%

                                                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, B \cdot B, 0.022222222222222223\right), x, -\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)\right) - x}{B} \]
                                                        7. Taylor expanded in B around 0

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

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

                                                          if -2.3e11 < F < 1.4199999999999999

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

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

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

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

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

                                                            if 1.4199999999999999 < F

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

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

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

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

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

                                                                  \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                                                              4. Recombined 3 regimes into one program.
                                                              5. Final simplification53.3%

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

                                                              Alternative 16: 49.8% accurate, 2.7× speedup?

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

                                                                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{\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 + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{5040} \cdot F + \left(\frac{1}{720} \cdot F + \frac{1}{6} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right)\right)\right) + \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right)\right)\right)\right) - x}{B}} \]
                                                                4. Applied rewrites45.7%

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

                                                                  \[\leadsto \frac{\left(-1 \cdot \left(1 + \frac{1}{6} \cdot {B}^{2}\right) + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{7}{360} + \frac{31}{15120} \cdot {B}^{2}\right) + \left(\frac{2}{945} \cdot \left({B}^{2} \cdot x\right) + \frac{1}{45} \cdot x\right)\right)\right)\right) - x}{B} \]
                                                                6. Applied rewrites56.0%

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, B \cdot B, 0.022222222222222223\right), x, -\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)\right) - x}{B} \]
                                                                7. Taylor expanded in B around 0

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

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

                                                                  if -2.3e11 < F < 1.4199999999999999

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

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

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

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

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

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

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

                                                                      if 1.4199999999999999 < F

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

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

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

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

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

                                                                            \[\leadsto \frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B} \]
                                                                        4. Recombined 3 regimes into one program.
                                                                        5. Final simplification53.3%

                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -230000000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1\right) - x}{B}\\ \mathbf{elif}\;F \leq 1.42:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - {\left(F \cdot F\right)}^{-1}\right) - x}{B}\\ \end{array} \]
                                                                        6. Add Preprocessing

                                                                        Alternative 17: 49.5% accurate, 8.8× speedup?

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

                                                                          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{\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 + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{5040} \cdot F + \left(\frac{1}{720} \cdot F + \frac{1}{6} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right)\right)\right) + \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right)\right)\right)\right) - x}{B}} \]
                                                                          4. Applied rewrites45.7%

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

                                                                            \[\leadsto \frac{\left(-1 \cdot \left(1 + \frac{1}{6} \cdot {B}^{2}\right) + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\frac{7}{360} + \frac{31}{15120} \cdot {B}^{2}\right) + \left(\frac{2}{945} \cdot \left({B}^{2} \cdot x\right) + \frac{1}{45} \cdot x\right)\right)\right)\right) - x}{B} \]
                                                                          6. Applied rewrites56.0%

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, B \cdot B, 0.022222222222222223\right), x, -\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)\right) - x}{B} \]
                                                                          7. Taylor expanded in B around 0

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

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

                                                                            if -2.3e11 < F < 2.49999999999999985e-12

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

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

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

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

                                                                                if 2.49999999999999985e-12 < F

                                                                                1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                Alternative 18: 49.2% accurate, 8.8× speedup?

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

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

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

                                                                                    if -1.90000000000000006e-23 < F < 2.49999999999999985e-12

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

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

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

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

                                                                                        if 2.49999999999999985e-12 < F

                                                                                        1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                        Alternative 19: 42.5% accurate, 13.6× speedup?

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

                                                                                          1. Initial program 76.3%

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

                                                                                            \[\leadsto \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.f6445.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 rewrites45.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 rewrites48.8%

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

                                                                                            if -3.9999999999999999e-60 < F < 5.40000000000000014e-24

                                                                                            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.f6453.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 rewrites53.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 rewrites42.5%

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

                                                                                              if 5.40000000000000014e-24 < F

                                                                                              1. Initial program 56.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.f6441.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 rewrites41.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 rewrites51.5%

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

                                                                                              Alternative 20: 35.7% accurate, 17.5× speedup?

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

                                                                                                1. Initial program 76.3%

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

                                                                                                  \[\leadsto \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.f6445.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 rewrites45.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 rewrites48.8%

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

                                                                                                  if -3.9999999999999999e-60 < F

                                                                                                  1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                  Alternative 21: 29.0% accurate, 26.3× speedup?

                                                                                                  \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                                                                  (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                                                                  double code(double F, double B, double x) {
                                                                                                  	return -x / B;
                                                                                                  }
                                                                                                  
                                                                                                  real(8) function code(f, b, x)
                                                                                                      real(8), intent (in) :: f
                                                                                                      real(8), intent (in) :: b
                                                                                                      real(8), intent (in) :: x
                                                                                                      code = -x / b
                                                                                                  end function
                                                                                                  
                                                                                                  public static double code(double F, double B, double x) {
                                                                                                  	return -x / B;
                                                                                                  }
                                                                                                  
                                                                                                  def code(F, B, x):
                                                                                                  	return -x / B
                                                                                                  
                                                                                                  function code(F, B, x)
                                                                                                  	return Float64(Float64(-x) / B)
                                                                                                  end
                                                                                                  
                                                                                                  function tmp = code(F, B, x)
                                                                                                  	tmp = -x / B;
                                                                                                  end
                                                                                                  
                                                                                                  code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                                                                  
                                                                                                  \begin{array}{l}
                                                                                                  
                                                                                                  \\
                                                                                                  \frac{-x}{B}
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Initial program 78.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.f6447.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 rewrites47.0%

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

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

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

                                                                                                    Reproduce

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