VandenBroeck and Keller, Equation (23)

Percentage Accurate: 75.7% → 99.6%
Time: 13.8s
Alternatives: 17
Speedup: 1.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 17 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: 75.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 1.4× speedup?

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

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

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

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


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

    1. Initial program 45.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.99999999999999972e71 < F < 5e5

      1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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} \]
      8. Taylor expanded in x around 0

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

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

          \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{{F}^{2} + 2}}} - \frac{x}{\tan B} \]
        3. unpow2N/A

          \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
        4. lower-fma.f6499.7

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

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

      if 5e5 < F

      1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 2: 75.4% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}^{\left(\frac{-1}{2}\right)} \cdot \frac{F}{\sin B} - \frac{1}{\tan B} \cdot x\\ t_1 := \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\\ t_2 := \frac{F}{t\_1 \cdot B} - \frac{x}{\tan B}\\ \mathbf{if}\;t\_0 \leq 10^{-200}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_0 \leq 1000000:\\ \;\;\;\;\frac{\frac{F}{t\_1}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+292}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (let* ((t_0
               (-
                (* (pow (+ (* x 2.0) (+ (* F F) 2.0)) (/ -1.0 2.0)) (/ F (sin B)))
                (* (/ 1.0 (tan B)) x)))
              (t_1 (sqrt (fma 2.0 x (fma F F 2.0))))
              (t_2 (- (/ F (* t_1 B)) (/ x (tan B)))))
         (if (<= t_0 1e-200)
           t_2
           (if (<= t_0 1000000.0)
             (- (/ (/ F t_1) (sin B)) (/ x B))
             (if (<= t_0 5e+292)
               t_2
               (/ (- (fma (/ -0.5 F) (/ (fma 2.0 x 2.0) F) 1.0) x) B))))))
      double code(double F, double B, double x) {
      	double t_0 = (pow(((x * 2.0) + ((F * F) + 2.0)), (-1.0 / 2.0)) * (F / sin(B))) - ((1.0 / tan(B)) * x);
      	double t_1 = sqrt(fma(2.0, x, fma(F, F, 2.0)));
      	double t_2 = (F / (t_1 * B)) - (x / tan(B));
      	double tmp;
      	if (t_0 <= 1e-200) {
      		tmp = t_2;
      	} else if (t_0 <= 1000000.0) {
      		tmp = ((F / t_1) / sin(B)) - (x / B);
      	} else if (t_0 <= 5e+292) {
      		tmp = t_2;
      	} else {
      		tmp = (fma((-0.5 / F), (fma(2.0, x, 2.0) / F), 1.0) - x) / B;
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	t_0 = Float64(Float64((Float64(Float64(x * 2.0) + Float64(Float64(F * F) + 2.0)) ^ Float64(-1.0 / 2.0)) * Float64(F / sin(B))) - Float64(Float64(1.0 / tan(B)) * x))
      	t_1 = sqrt(fma(2.0, x, fma(F, F, 2.0)))
      	t_2 = Float64(Float64(F / Float64(t_1 * B)) - Float64(x / tan(B)))
      	tmp = 0.0
      	if (t_0 <= 1e-200)
      		tmp = t_2;
      	elseif (t_0 <= 1000000.0)
      		tmp = Float64(Float64(Float64(F / t_1) / sin(B)) - Float64(x / B));
      	elseif (t_0 <= 5e+292)
      		tmp = t_2;
      	else
      		tmp = Float64(Float64(fma(Float64(-0.5 / F), Float64(fma(2.0, x, 2.0) / F), 1.0) - x) / B);
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Power[N[(N[(x * 2.0), $MachinePrecision] + N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(F / N[(t$95$1 * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-200], t$95$2, If[LessEqual[t$95$0, 1000000.0], N[(N[(N[(F / t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+292], t$95$2, N[(N[(N[(N[(-0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := {\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}^{\left(\frac{-1}{2}\right)} \cdot \frac{F}{\sin B} - \frac{1}{\tan B} \cdot x\\
      t_1 := \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\\
      t_2 := \frac{F}{t\_1 \cdot B} - \frac{x}{\tan B}\\
      \mathbf{if}\;t\_0 \leq 10^{-200}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;t\_0 \leq 1000000:\\
      \;\;\;\;\frac{\frac{F}{t\_1}}{\sin B} - \frac{x}{B}\\
      
      \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+292}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 9.9999999999999998e-201 or 1e6 < (+.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)))))) < 4.9999999999999996e292

        1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\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} \]
        8. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

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

        if 9.9999999999999998e-201 < (+.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)))))) < 1e6

        1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(-F\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-1}{\sin B}, \frac{-x}{\tan B}\right)} \]
        5. Applied rewrites79.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 B around 0

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

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

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

        if 4.9999999999999996e292 < (+.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 21.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. +-commutativeN/A

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

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

            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
          11. +-commutativeN/A

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

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

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

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

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

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

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

        Alternative 3: 75.4% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}^{\left(\frac{-1}{2}\right)} \cdot \frac{F}{\sin B} - \frac{1}{\tan B} \cdot x\\ t_1 := \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot B} - \frac{x}{\tan B}\\ \mathbf{if}\;t\_0 \leq 10^{-200}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 1000000:\\ \;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{B}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+292}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (let* ((t_0
                 (-
                  (* (pow (+ (* x 2.0) (+ (* F F) 2.0)) (/ -1.0 2.0)) (/ F (sin B)))
                  (* (/ 1.0 (tan B)) x)))
                (t_1 (- (/ F (* (sqrt (fma 2.0 x (fma F F 2.0))) B)) (/ x (tan B)))))
           (if (<= t_0 1e-200)
             t_1
             (if (<= t_0 1000000.0)
               (- (/ F (* (sqrt (fma x 2.0 (fma F F 2.0))) (sin B))) (/ x B))
               (if (<= t_0 5e+292)
                 t_1
                 (/ (- (fma (/ -0.5 F) (/ (fma 2.0 x 2.0) F) 1.0) x) B))))))
        double code(double F, double B, double x) {
        	double t_0 = (pow(((x * 2.0) + ((F * F) + 2.0)), (-1.0 / 2.0)) * (F / sin(B))) - ((1.0 / tan(B)) * x);
        	double t_1 = (F / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)) - (x / tan(B));
        	double tmp;
        	if (t_0 <= 1e-200) {
        		tmp = t_1;
        	} else if (t_0 <= 1000000.0) {
        		tmp = (F / (sqrt(fma(x, 2.0, fma(F, F, 2.0))) * sin(B))) - (x / B);
        	} else if (t_0 <= 5e+292) {
        		tmp = t_1;
        	} else {
        		tmp = (fma((-0.5 / F), (fma(2.0, x, 2.0) / F), 1.0) - x) / B;
        	}
        	return tmp;
        }
        
        function code(F, B, x)
        	t_0 = Float64(Float64((Float64(Float64(x * 2.0) + Float64(Float64(F * F) + 2.0)) ^ Float64(-1.0 / 2.0)) * Float64(F / sin(B))) - Float64(Float64(1.0 / tan(B)) * x))
        	t_1 = Float64(Float64(F / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)) - Float64(x / tan(B)))
        	tmp = 0.0
        	if (t_0 <= 1e-200)
        		tmp = t_1;
        	elseif (t_0 <= 1000000.0)
        		tmp = Float64(Float64(F / Float64(sqrt(fma(x, 2.0, fma(F, F, 2.0))) * sin(B))) - Float64(x / B));
        	elseif (t_0 <= 5e+292)
        		tmp = t_1;
        	else
        		tmp = Float64(Float64(fma(Float64(-0.5 / F), Float64(fma(2.0, x, 2.0) / F), 1.0) - x) / B);
        	end
        	return tmp
        end
        
        code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Power[N[(N[(x * 2.0), $MachinePrecision] + N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(F / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-200], t$95$1, If[LessEqual[t$95$0, 1000000.0], N[(N[(F / N[(N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+292], t$95$1, N[(N[(N[(N[(-0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := {\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}^{\left(\frac{-1}{2}\right)} \cdot \frac{F}{\sin B} - \frac{1}{\tan B} \cdot x\\
        t_1 := \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot B} - \frac{x}{\tan B}\\
        \mathbf{if}\;t\_0 \leq 10^{-200}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t\_0 \leq 1000000:\\
        \;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{B}\\
        
        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+292}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 9.9999999999999998e-201 or 1e6 < (+.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)))))) < 4.9999999999999996e292

          1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\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} \]
          8. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

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

          if 9.9999999999999998e-201 < (+.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)))))) < 1e6

          1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(-F\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-1}{\sin B}, \frac{-x}{\tan B}\right)} \]
          5. Applied rewrites79.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-*.f6479.5

              \[\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.f6479.5

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

            \[\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} \]
          8. Taylor expanded in B around 0

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

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

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

          if 4.9999999999999996e292 < (+.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 21.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. +-commutativeN/A

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

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

              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
            11. +-commutativeN/A

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

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

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

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

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

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

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

          Alternative 4: 75.3% accurate, 0.3× speedup?

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

            1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

              \[\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-*.f6488.1

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

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

              \[\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} \]
            8. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

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

            if 9.9999999999999995e-8 < (+.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)))))) < 1e6

            1. Initial program 90.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.f6485.4

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

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

            if 4.9999999999999996e292 < (+.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 21.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. +-commutativeN/A

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

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

                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
              11. +-commutativeN/A

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

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

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

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

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

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

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

            Alternative 5: 92.2% accurate, 1.5× speedup?

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

              1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -3.8e13 < F < 4.2e5

                1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\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} \]
                8. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

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

                if 4.2e5 < F

                1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 6: 81.3% accurate, 1.6× speedup?

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

                  1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

                    \[\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-*.f6487.2

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

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

                    \[\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} \]
                  8. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

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

                  if 4.2e5 < F

                  1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 7: 81.3% accurate, 1.6× speedup?

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

                    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

                      \[\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-*.f6487.2

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

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

                      \[\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} \]
                    8. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

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

                    if 4.2e5 < F

                    1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 8: 55.8% accurate, 2.5× speedup?

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

                      1. Initial program 76.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) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                      4. Applied rewrites57.6%

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

                      if 122 < B

                      1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{F}{B} \cdot \frac{1}{\color{blue}{F}} - \frac{x}{\tan B} \]
                      10. Step-by-step derivation
                        1. Applied rewrites58.6%

                          \[\leadsto \frac{F}{B} \cdot \frac{1}{\color{blue}{F}} - \frac{x}{\tan B} \]
                      11. Recombined 2 regimes into one program.
                      12. Final simplification57.8%

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

                      Alternative 9: 55.8% accurate, 2.5× speedup?

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

                        1. Initial program 76.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) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                        4. Applied rewrites57.6%

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

                        if 122 < B

                        1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{F}{B} \cdot \frac{-1}{\color{blue}{F}} - \frac{x}{\tan B} \]
                        10. Step-by-step derivation
                          1. Applied rewrites58.6%

                            \[\leadsto \frac{F}{B} \cdot \frac{-1}{\color{blue}{F}} - \frac{x}{\tan B} \]
                        11. Recombined 2 regimes into one program.
                        12. Final simplification57.8%

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

                        Alternative 10: 55.4% accurate, 2.8× speedup?

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

                          1. Initial program 76.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) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                          4. Applied rewrites57.6%

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

                          if 122 < B

                          1. Initial program 79.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 F around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 11: 50.9% accurate, 2.8× speedup?

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

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

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

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

                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                11. +-commutativeN/A

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\frac{1}{\frac{-1 + x}{\left(-1 + x\right) \cdot \left(-1 - x\right)}}}{B} \]

                                  if -1.35000000000000003e154 < F < 3.30000000000000026e30

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

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

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

                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                    11. +-commutativeN/A

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

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

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

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

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

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

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

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

                                    if 3.30000000000000026e30 < F < 3.09999999999999996e168

                                    1. Initial program 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 3.09999999999999996e168 < F

                                      1. Initial program 32.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                                        4. Recombined 4 regimes into one program.
                                        5. Final simplification56.4%

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

                                        Alternative 12: 50.9% accurate, 6.8× speedup?

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

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

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

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

                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                            11. +-commutativeN/A

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{\frac{1}{\frac{-1 + x}{\left(-1 + x\right) \cdot \left(-1 - x\right)}}}{B} \]

                                              if -1.35000000000000003e154 < F < 1.89999999999999992e62

                                              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 \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. +-commutativeN/A

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

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

                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                11. +-commutativeN/A

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

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

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

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

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

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

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

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

                                                if 1.89999999999999992e62 < F

                                                1. Initial program 48.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                Alternative 13: 51.3% accurate, 6.8× speedup?

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

                                                  1. Initial program 32.4%

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    11. +-commutativeN/A

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

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

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

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

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

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

                                                    if -4e129 < F < 1.89999999999999992e62

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

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

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

                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      11. +-commutativeN/A

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

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

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

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

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

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

                                                      \[\leadsto \frac{\frac{F}{\sqrt{2 + {F}^{2}}} - x}{B} \]
                                                    8. Step-by-step derivation
                                                      1. Applied rewrites57.9%

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

                                                      if 1.89999999999999992e62 < F

                                                      1. Initial program 48.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      Alternative 14: 51.0% accurate, 7.7× speedup?

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

                                                        1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          11. +-commutativeN/A

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

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

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

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

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

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

                                                          if -1.3999999999999999 < F < 22.5

                                                          1. Initial program 99.4%

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

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

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

                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            11. +-commutativeN/A

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

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

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

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

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

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

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

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

                                                              \[\leadsto \frac{\frac{F}{\sqrt{2}} - x}{B} \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites59.6%

                                                                \[\leadsto \frac{\frac{F}{\sqrt{2}} - x}{B} \]

                                                              if 22.5 < F

                                                              1. Initial program 55.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              Alternative 15: 42.6% accurate, 13.6× speedup?

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

                                                                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. 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. +-commutativeN/A

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

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

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  11. +-commutativeN/A

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

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

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

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

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

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

                                                                  if -7.60000000000000007e-193 < F < 6.2000000000000003e-90

                                                                  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. +-commutativeN/A

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

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

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    11. +-commutativeN/A

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

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

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

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

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

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

                                                                    if 6.2000000000000003e-90 < F

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

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

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

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      11. +-commutativeN/A

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

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

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

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

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

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

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

                                                                    Alternative 16: 35.4% accurate, 17.5× speedup?

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

                                                                      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. 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. +-commutativeN/A

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

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

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        11. +-commutativeN/A

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

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

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

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

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

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

                                                                        if -7.60000000000000007e-193 < F

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

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

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

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          11. +-commutativeN/A

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

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

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

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

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

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

                                                                        Alternative 17: 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 76.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. +-commutativeN/A

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

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

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 \cdot x + \color{blue}{\left(2 + {F}^{2}\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(2, x, 2 + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          11. +-commutativeN/A

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

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

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

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

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

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

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

                                                                          Reproduce

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