VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.5% → 99.6%
Time: 13.5s
Alternatives: 22
Speedup: 2.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 77.5% 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, 0.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1} - \cos B \cdot \frac{x}{\sin B}\\


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

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

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

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

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

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

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

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

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

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

      if -9.99999999999999959e87 < F < 2e4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2e4 < F

      1. Initial program 65.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.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}} \]
    8. Recombined 3 regimes into one program.
    9. Final simplification99.8%

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

    Alternative 2: 99.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

        if -9.99999999999999959e87 < F < 1.15e8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.15e8 < F

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

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

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

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

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

        Alternative 3: 56.8% accurate, 1.1× speedup?

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

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

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

          if 3600 < B

          1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
          7. Recombined 2 regimes into one program.
          8. Final simplification57.6%

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

          Alternative 4: 91.4% accurate, 1.3× speedup?

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

            1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -3.6e12 < F < -4.6999999999999999e-169

              1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\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}} \]
              9. 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}{B}} \]
                2. sub-negN/A

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

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

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

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

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

              if -4.6999999999999999e-169 < F < 32

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

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

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

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

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

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

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

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

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

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

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

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

              if 32 < F

              1. Initial program 66.0%

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

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

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

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

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

              Alternative 5: 91.8% accurate, 1.3× speedup?

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

                1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -3.6e12 < F < -8.00000000000000054e-138

                  1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
                  6. Taylor expanded in 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-/.f6485.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}} \]
                  8. Applied rewrites85.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}} \]
                  9. 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}{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}{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}{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}{B} \]
                    5. *-commutativeN/A

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

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

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

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

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

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

                  if -8.00000000000000054e-138 < F < 32

                  1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 32 < F

                  1. Initial program 66.0%

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

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

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

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

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

                  Alternative 6: 79.7% accurate, 1.4× speedup?

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

                    1. Initial program 37.7%

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

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

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

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

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

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

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

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

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

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

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

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

                      if -1.15e147 < F < 32

                      1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 32 < F

                      1. Initial program 66.0%

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

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

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

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

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

                      Alternative 7: 99.5% accurate, 1.4× speedup?

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

                        1. Initial program 34.0%

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

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

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

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

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

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

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

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

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

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

                          \[\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 -2.4999999999999998e158 < F < 1.12e8

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

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

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

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

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

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

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

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

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

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

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

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

                          if 1.12e8 < F

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

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

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

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

                          Alternative 8: 99.0% accurate, 1.4× speedup?

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

                            1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\frac{F}{\sqrt{2}}}{\sin B} - \frac{x}{\tan B} \]
                              10. Step-by-step derivation
                                1. Applied rewrites99.4%

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

                                if 1.44999999999999996 < F

                                1. Initial program 66.0%

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

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

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

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

                                Alternative 9: 70.5% accurate, 1.5× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{-41} \lor \neg \left(x \leq 4 \cdot 10^{-113}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (if (or (<= x -1.75e-41) (not (<= x 4e-113)))
                                   (/ (- x) (tan B))
                                   (* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if ((x <= -1.75e-41) || !(x <= 4e-113)) {
                                		tmp = -x / tan(B);
                                	} else {
                                		tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
                                	}
                                	return tmp;
                                }
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if ((x <= -1.75e-41) || !(x <= 4e-113))
                                		tmp = Float64(Float64(-x) / tan(B));
                                	else
                                		tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B)));
                                	end
                                	return tmp
                                end
                                
                                code[F_, B_, x_] := If[Or[LessEqual[x, -1.75e-41], N[Not[LessEqual[x, 4e-113]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;x \leq -1.75 \cdot 10^{-41} \lor \neg \left(x \leq 4 \cdot 10^{-113}\right):\\
                                \;\;\;\;\frac{-x}{\tan B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if x < -1.75e-41 or 3.99999999999999991e-113 < x

                                  1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                    if -1.75e-41 < x < 3.99999999999999991e-113

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

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

                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}} \]
                                  7. Recombined 2 regimes into one program.
                                  8. Final simplification75.5%

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

                                  Alternative 10: 56.8% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if 3600 < B

                                    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 11: 77.7% accurate, 2.2× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{-25} \lor \neg \left(x \leq 1.4 \cdot 10^{-29}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
                                    (FPCore (F B x)
                                     :precision binary64
                                     (if (or (<= x -4.1e-25) (not (<= x 1.4e-29)))
                                       (/ (- x) (tan B))
                                       (- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) (/ x B))))
                                    double code(double F, double B, double x) {
                                    	double tmp;
                                    	if ((x <= -4.1e-25) || !(x <= 1.4e-29)) {
                                    		tmp = -x / tan(B);
                                    	} else {
                                    		tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - (x / B);
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(F, B, x)
                                    	tmp = 0.0
                                    	if ((x <= -4.1e-25) || !(x <= 1.4e-29))
                                    		tmp = Float64(Float64(-x) / tan(B));
                                    	else
                                    		tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[F_, B_, x_] := If[Or[LessEqual[x, -4.1e-25], N[Not[LessEqual[x, 1.4e-29]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;x \leq -4.1 \cdot 10^{-25} \lor \neg \left(x \leq 1.4 \cdot 10^{-29}\right):\\
                                    \;\;\;\;\frac{-x}{\tan B}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if x < -4.09999999999999987e-25 or 1.4000000000000001e-29 < x

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

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

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

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

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

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

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

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

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

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

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

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

                                        if -4.09999999999999987e-25 < x < 1.4000000000000001e-29

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

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

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

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

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

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

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

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

                                          \[\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. Recombined 2 regimes into one program.
                                      8. Final simplification80.9%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{-25} \lor \neg \left(x \leq 1.4 \cdot 10^{-29}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \end{array} \]
                                      9. Add Preprocessing

                                      Alternative 12: 77.7% accurate, 2.2× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{-25} \lor \neg \left(x \leq 1.4 \cdot 10^{-29}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
                                      (FPCore (F B x)
                                       :precision binary64
                                       (if (or (<= x -4.1e-25) (not (<= x 1.4e-29)))
                                         (/ (- x) (tan B))
                                         (- (/ F (* (sqrt (fma x 2.0 (fma F F 2.0))) (sin B))) (/ x B))))
                                      double code(double F, double B, double x) {
                                      	double tmp;
                                      	if ((x <= -4.1e-25) || !(x <= 1.4e-29)) {
                                      		tmp = -x / tan(B);
                                      	} else {
                                      		tmp = (F / (sqrt(fma(x, 2.0, fma(F, F, 2.0))) * sin(B))) - (x / B);
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(F, B, x)
                                      	tmp = 0.0
                                      	if ((x <= -4.1e-25) || !(x <= 1.4e-29))
                                      		tmp = Float64(Float64(-x) / tan(B));
                                      	else
                                      		tmp = Float64(Float64(F / Float64(sqrt(fma(x, 2.0, fma(F, F, 2.0))) * sin(B))) - Float64(x / B));
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[F_, B_, x_] := If[Or[LessEqual[x, -4.1e-25], N[Not[LessEqual[x, 1.4e-29]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], 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]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;x \leq -4.1 \cdot 10^{-25} \lor \neg \left(x \leq 1.4 \cdot 10^{-29}\right):\\
                                      \;\;\;\;\frac{-x}{\tan B}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{B}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if x < -4.09999999999999987e-25 or 1.4000000000000001e-29 < x

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

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

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

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

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

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

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

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

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

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

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

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

                                          if -4.09999999999999987e-25 < x < 1.4000000000000001e-29

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

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

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

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

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

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

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

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

                                            \[\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}} \]
                                          9. 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}{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}{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}{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}{B} \]
                                            5. *-commutativeN/A

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

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

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

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

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

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

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{-25} \lor \neg \left(x \leq 1.4 \cdot 10^{-29}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
                                        9. Add Preprocessing

                                        Alternative 13: 50.6% accurate, 2.4× speedup?

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

                                          1. Initial program 49.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if -4e113 < F < 7.5000000000000003e46

                                            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. associate-+r+N/A

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

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

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

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

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

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

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

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

                                            if 7.5000000000000003e46 < F

                                            1. Initial program 63.5%

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

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

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

                                            Alternative 14: 30.2% accurate, 3.2× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-41} \lor \neg \left(x \leq 2.5 \cdot 10^{-103}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;{B}^{-1}\\ \end{array} \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (or (<= x -2.1e-41) (not (<= x 2.5e-103))) (/ (- x) B) (pow B -1.0)))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if ((x <= -2.1e-41) || !(x <= 2.5e-103)) {
                                            		tmp = -x / B;
                                            	} else {
                                            		tmp = pow(B, -1.0);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            real(8) function code(f, b, x)
                                                real(8), intent (in) :: f
                                                real(8), intent (in) :: b
                                                real(8), intent (in) :: x
                                                real(8) :: tmp
                                                if ((x <= (-2.1d-41)) .or. (.not. (x <= 2.5d-103))) then
                                                    tmp = -x / b
                                                else
                                                    tmp = b ** (-1.0d0)
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double tmp;
                                            	if ((x <= -2.1e-41) || !(x <= 2.5e-103)) {
                                            		tmp = -x / B;
                                            	} else {
                                            		tmp = Math.pow(B, -1.0);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	tmp = 0
                                            	if (x <= -2.1e-41) or not (x <= 2.5e-103):
                                            		tmp = -x / B
                                            	else:
                                            		tmp = math.pow(B, -1.0)
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if ((x <= -2.1e-41) || !(x <= 2.5e-103))
                                            		tmp = Float64(Float64(-x) / B);
                                            	else
                                            		tmp = B ^ -1.0;
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	tmp = 0.0;
                                            	if ((x <= -2.1e-41) || ~((x <= 2.5e-103)))
                                            		tmp = -x / B;
                                            	else
                                            		tmp = B ^ -1.0;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := If[Or[LessEqual[x, -2.1e-41], N[Not[LessEqual[x, 2.5e-103]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[Power[B, -1.0], $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;x \leq -2.1 \cdot 10^{-41} \lor \neg \left(x \leq 2.5 \cdot 10^{-103}\right):\\
                                            \;\;\;\;\frac{-x}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;{B}^{-1}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if x < -2.10000000000000013e-41 or 2.49999999999999983e-103 < x

                                              1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                if -2.10000000000000013e-41 < x < 2.49999999999999983e-103

                                                1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{1}{B} \]
                                                  4. Recombined 2 regimes into one program.
                                                  5. Final simplification32.1%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-41} \lor \neg \left(x \leq 2.5 \cdot 10^{-103}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;{B}^{-1}\\ \end{array} \]
                                                  6. Add Preprocessing

                                                  Alternative 15: 36.8% accurate, 3.2× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.2 \cdot 10^{-73}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4.9 \cdot 10^{+14}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;{B}^{-1}\\ \end{array} \end{array} \]
                                                  (FPCore (F B x)
                                                   :precision binary64
                                                   (if (<= F -6.2e-73)
                                                     (/ (- -1.0 x) B)
                                                     (if (<= F 4.9e+14) (/ (- x) B) (pow B -1.0))))
                                                  double code(double F, double B, double x) {
                                                  	double tmp;
                                                  	if (F <= -6.2e-73) {
                                                  		tmp = (-1.0 - x) / B;
                                                  	} else if (F <= 4.9e+14) {
                                                  		tmp = -x / B;
                                                  	} else {
                                                  		tmp = pow(B, -1.0);
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  real(8) function code(f, b, x)
                                                      real(8), intent (in) :: f
                                                      real(8), intent (in) :: b
                                                      real(8), intent (in) :: x
                                                      real(8) :: tmp
                                                      if (f <= (-6.2d-73)) then
                                                          tmp = ((-1.0d0) - x) / b
                                                      else if (f <= 4.9d+14) then
                                                          tmp = -x / b
                                                      else
                                                          tmp = b ** (-1.0d0)
                                                      end if
                                                      code = tmp
                                                  end function
                                                  
                                                  public static double code(double F, double B, double x) {
                                                  	double tmp;
                                                  	if (F <= -6.2e-73) {
                                                  		tmp = (-1.0 - x) / B;
                                                  	} else if (F <= 4.9e+14) {
                                                  		tmp = -x / B;
                                                  	} else {
                                                  		tmp = Math.pow(B, -1.0);
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  def code(F, B, x):
                                                  	tmp = 0
                                                  	if F <= -6.2e-73:
                                                  		tmp = (-1.0 - x) / B
                                                  	elif F <= 4.9e+14:
                                                  		tmp = -x / B
                                                  	else:
                                                  		tmp = math.pow(B, -1.0)
                                                  	return tmp
                                                  
                                                  function code(F, B, x)
                                                  	tmp = 0.0
                                                  	if (F <= -6.2e-73)
                                                  		tmp = Float64(Float64(-1.0 - x) / B);
                                                  	elseif (F <= 4.9e+14)
                                                  		tmp = Float64(Float64(-x) / B);
                                                  	else
                                                  		tmp = B ^ -1.0;
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  function tmp_2 = code(F, B, x)
                                                  	tmp = 0.0;
                                                  	if (F <= -6.2e-73)
                                                  		tmp = (-1.0 - x) / B;
                                                  	elseif (F <= 4.9e+14)
                                                  		tmp = -x / B;
                                                  	else
                                                  		tmp = B ^ -1.0;
                                                  	end
                                                  	tmp_2 = tmp;
                                                  end
                                                  
                                                  code[F_, B_, x_] := If[LessEqual[F, -6.2e-73], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.9e+14], N[((-x) / B), $MachinePrecision], N[Power[B, -1.0], $MachinePrecision]]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;F \leq -6.2 \cdot 10^{-73}:\\
                                                  \;\;\;\;\frac{-1 - x}{B}\\
                                                  
                                                  \mathbf{elif}\;F \leq 4.9 \cdot 10^{+14}:\\
                                                  \;\;\;\;\frac{-x}{B}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;{B}^{-1}\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 3 regimes
                                                  2. if F < -6.19999999999999938e-73

                                                    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      if -6.19999999999999938e-73 < F < 4.9e14

                                                      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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                                                        if 4.9e14 < F

                                                        1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto \frac{1}{B} \]
                                                          4. Recombined 3 regimes into one program.
                                                          5. Final simplification36.1%

                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.2 \cdot 10^{-73}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4.9 \cdot 10^{+14}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;{B}^{-1}\\ \end{array} \]
                                                          6. Add Preprocessing

                                                          Alternative 16: 17.3% accurate, 3.4× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 3 \cdot 10^{-187}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;{B}^{-1}\\ \end{array} \end{array} \]
                                                          (FPCore (F B x) :precision binary64 (if (<= F 3e-187) (/ -1.0 B) (pow B -1.0)))
                                                          double code(double F, double B, double x) {
                                                          	double tmp;
                                                          	if (F <= 3e-187) {
                                                          		tmp = -1.0 / B;
                                                          	} else {
                                                          		tmp = pow(B, -1.0);
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          real(8) function code(f, b, x)
                                                              real(8), intent (in) :: f
                                                              real(8), intent (in) :: b
                                                              real(8), intent (in) :: x
                                                              real(8) :: tmp
                                                              if (f <= 3d-187) then
                                                                  tmp = (-1.0d0) / b
                                                              else
                                                                  tmp = b ** (-1.0d0)
                                                              end if
                                                              code = tmp
                                                          end function
                                                          
                                                          public static double code(double F, double B, double x) {
                                                          	double tmp;
                                                          	if (F <= 3e-187) {
                                                          		tmp = -1.0 / B;
                                                          	} else {
                                                          		tmp = Math.pow(B, -1.0);
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          def code(F, B, x):
                                                          	tmp = 0
                                                          	if F <= 3e-187:
                                                          		tmp = -1.0 / B
                                                          	else:
                                                          		tmp = math.pow(B, -1.0)
                                                          	return tmp
                                                          
                                                          function code(F, B, x)
                                                          	tmp = 0.0
                                                          	if (F <= 3e-187)
                                                          		tmp = Float64(-1.0 / B);
                                                          	else
                                                          		tmp = B ^ -1.0;
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          function tmp_2 = code(F, B, x)
                                                          	tmp = 0.0;
                                                          	if (F <= 3e-187)
                                                          		tmp = -1.0 / B;
                                                          	else
                                                          		tmp = B ^ -1.0;
                                                          	end
                                                          	tmp_2 = tmp;
                                                          end
                                                          
                                                          code[F_, B_, x_] := If[LessEqual[F, 3e-187], N[(-1.0 / B), $MachinePrecision], N[Power[B, -1.0], $MachinePrecision]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;F \leq 3 \cdot 10^{-187}:\\
                                                          \;\;\;\;\frac{-1}{B}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;{B}^{-1}\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 2 regimes
                                                          2. if F < 3.00000000000000004e-187

                                                            1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                if 3.00000000000000004e-187 < F

                                                                1. Initial program 77.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      \[\leadsto \frac{1}{B} \]
                                                                  4. Recombined 2 regimes into one program.
                                                                  5. Final simplification18.2%

                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 3 \cdot 10^{-187}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;{B}^{-1}\\ \end{array} \]
                                                                  6. Add Preprocessing

                                                                  Alternative 17: 50.5% accurate, 6.8× speedup?

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

                                                                    1. Initial program 34.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      if -2.4999999999999998e158 < F < 7.5000000000000003e46

                                                                      1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        if 7.5000000000000003e46 < F

                                                                        1. Initial program 63.5%

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

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

                                                                        Alternative 18: 50.2% accurate, 6.8× speedup?

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

                                                                          1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                            if -100 < F < 15200

                                                                            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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                                                                              if 15200 < F

                                                                              1. Initial program 65.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.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 rewrites54.3%

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

                                                                              Alternative 19: 43.2% accurate, 7.1× speedup?

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

                                                                                1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                  if -6.19999999999999938e-73 < F < 4.4999999999999998e-101

                                                                                  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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                                                                                    if 4.4999999999999998e-101 < F < 0.299999999999999989

                                                                                    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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

                                                                                        if 0.299999999999999989 < F

                                                                                        1. Initial program 66.0%

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

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

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

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

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

                                                                                        Alternative 20: 43.2% accurate, 7.2× speedup?

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

                                                                                          1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                            if -6.19999999999999938e-73 < F < 4.4999999999999998e-101

                                                                                            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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                                                                                              if 4.4999999999999998e-101 < F < 0.299999999999999989

                                                                                              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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

                                                                                                  if 0.299999999999999989 < F

                                                                                                  1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                  Alternative 21: 43.0% accurate, 13.6× speedup?

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

                                                                                                    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                      if -6.19999999999999938e-73 < F < 7.20000000000000014e-37

                                                                                                      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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                                                                                                        if 7.20000000000000014e-37 < F

                                                                                                        1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                        Alternative 22: 10.5% accurate, 30.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                            Reproduce

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