VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.1% → 99.1%
Time: 14.0s
Alternatives: 27
Speedup: 2.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 27 alternatives:

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

Initial Program: 76.1% 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.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -2.05 \cdot 10^{+97}:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{+38}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\left(\frac{-1}{2}\right)} - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B)))))
   (if (<= F -2.05e+97)
     (+ t_0 (/ -1.0 (sin B)))
     (if (<= F 2.7e+38)
       (-
        (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) (/ -1.0 2.0)))
        (/ (* x (cos B)) (sin B)))
       (+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double tmp;
	if (F <= -2.05e+97) {
		tmp = t_0 + (-1.0 / sin(B));
	} else if (F <= 2.7e+38) {
		tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), (-1.0 / 2.0))) - ((x * cos(B)) / sin(B));
	} else {
		tmp = t_0 + (1.0 / 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 * ((-1.0d0) / tan(b))
    if (f <= (-2.05d+97)) then
        tmp = t_0 + ((-1.0d0) / sin(b))
    else if (f <= 2.7d+38) then
        tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** ((-1.0d0) / 2.0d0))) - ((x * cos(b)) / sin(b))
    else
        tmp = t_0 + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / Math.tan(B));
	double tmp;
	if (F <= -2.05e+97) {
		tmp = t_0 + (-1.0 / Math.sin(B));
	} else if (F <= 2.7e+38) {
		tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), (-1.0 / 2.0))) - ((x * Math.cos(B)) / Math.sin(B));
	} else {
		tmp = t_0 + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (-1.0 / math.tan(B))
	tmp = 0
	if F <= -2.05e+97:
		tmp = t_0 + (-1.0 / math.sin(B))
	elif F <= 2.7e+38:
		tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), (-1.0 / 2.0))) - ((x * math.cos(B)) / math.sin(B))
	else:
		tmp = t_0 + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B)))
	tmp = 0.0
	if (F <= -2.05e+97)
		tmp = Float64(t_0 + Float64(-1.0 / sin(B)));
	elseif (F <= 2.7e+38)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ Float64(-1.0 / 2.0))) - Float64(Float64(x * cos(B)) / sin(B)));
	else
		tmp = Float64(t_0 + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (-1.0 / tan(B));
	tmp = 0.0;
	if (F <= -2.05e+97)
		tmp = t_0 + (-1.0 / sin(B));
	elseif (F <= 2.7e+38)
		tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ (-1.0 / 2.0))) - ((x * cos(B)) / sin(B));
	else
		tmp = t_0 + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.05e+97], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e+38], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 2.7 \cdot 10^{+38}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\left(\frac{-1}{2}\right)} - \frac{x \cdot \cos B}{\sin B}\\

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


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

    1. Initial program 42.9%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.6%

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

    if -2.04999999999999994e97 < F < 2.69999999999999996e38

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(\frac{x \cdot \color{blue}{\cos B}}{\sin B}\right)\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
      4. lower-sin.f6499.5

        \[\leadsto \left(-\frac{x \cdot \cos B}{\color{blue}{\sin B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified99.5%

      \[\leadsto \left(-\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]

    if 2.69999999999999996e38 < F

    1. Initial program 63.4%

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

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
      2. lower-sin.f6499.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
    5. Simplified99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{+97}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{+38}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\left(\frac{-1}{2}\right)} - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.25 \cdot 10^{+38}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\

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


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

    1. Initial program 42.9%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.6%

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

    if -2.30000000000000006e97 < F < 1.24999999999999992e38

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.24999999999999992e38 < F

    1. Initial program 63.4%

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

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
      2. lower-sin.f6499.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
    5. Simplified99.7%

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

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

Alternative 3: 99.6% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 54.9%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.6%

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

    if -2.5e8 < F < 2e7

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e7 < F

    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 F around inf

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
      2. lower-sin.f6499.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
    5. Simplified99.7%

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

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

Alternative 4: 98.9% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_0 + \frac{F \cdot \sqrt{0.5}}{\sin B}\\

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


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

    1. Initial program 56.1%

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

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6498.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified98.7%

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

    if -1.3999999999999999 < F < 1.3999999999999999

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\sqrt{0.5} \cdot F}{\color{blue}{\sin B}} \]
    8. Simplified99.4%

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

    if 1.3999999999999999 < F

    1. Initial program 68.4%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
    5. Simplified99.6%

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

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

Alternative 5: 91.7% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -8.5 \cdot 10^{-156}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 9 \cdot 10^{-151}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\

\mathbf{elif}\;F \leq 0.0195:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -1.9500000000000001e22

    1. Initial program 51.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.6%

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

    if -1.9500000000000001e22 < F < -8.5e-156

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e-156 < F < 9.0000000000000005e-151

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000005e-151 < F < 0.0195

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2}}}}{\sin B} \]
    10. Step-by-step derivation
      1. lower-sqrt.f6493.3

        \[\leadsto \left(-\frac{x}{B}\right) + F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} \]
    11. Simplified93.3%

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

    if 0.0195 < F

    1. Initial program 68.4%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
    5. Simplified99.6%

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

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

Alternative 6: 85.8% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
t_0 := F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{B}\\
t_1 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.95 \cdot 10^{+22}:\\
\;\;\;\;t\_1 + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq -8.5 \cdot 10^{-156}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 9 \cdot 10^{-151}:\\
\;\;\;\;t\_1 + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\

\mathbf{elif}\;F \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.9500000000000001e22

    1. Initial program 51.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.6%

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

    if -1.9500000000000001e22 < F < -8.5e-156 or 9.0000000000000005e-151 < F < 1.31999999999999998e154

    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. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e-156 < F < 9.0000000000000005e-151

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

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

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

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

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

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

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

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

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

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

    if 1.31999999999999998e154 < F

    1. Initial program 43.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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    8. Simplified84.3%

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

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

Alternative 7: 78.9% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;F \leq 9 \cdot 10^{-151}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\

\mathbf{elif}\;F \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -9.9999999999999997e98

    1. Initial program 40.9%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.6%

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

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) + \frac{-1}{\sin B} \]
    7. Step-by-step derivation
      1. lower-/.f6477.0

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    8. Simplified77.0%

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

    if -9.9999999999999997e98 < F < 9.0000000000000005e-151

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000005e-151 < F < 1.31999999999999998e154

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.31999999999999998e154 < F

    1. Initial program 43.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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    8. Simplified84.3%

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

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

Alternative 8: 75.8% accurate, 2.2× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.79999999999999988e-30 or 4.2e5 < x

    1. Initial program 79.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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{1}{B}} \]
    7. Step-by-step derivation
      1. lower-/.f6495.9

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    8. Simplified95.9%

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

    if -2.79999999999999988e-30 < x < 4.2e5

    1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.3%

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

Alternative 9: 72.4% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.65 \cdot 10^{-284}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{-254}:\\ \;\;\;\;t\_0 + \frac{F}{B} \cdot \frac{1}{F}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B)))))
   (if (<= F -1.4)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -1.65e-284)
       (- (/ (* F (sqrt 0.5)) (sin B)) (/ x B))
       (if (<= F 5.4e-254)
         (+ t_0 (* (/ F B) (/ 1.0 F)))
         (if (<= F 1.4)
           (- (* F (/ (sqrt 0.5) (sin B))) (/ x B))
           (if (<= F 6e+154)
             (- (/ 1.0 (sin B)) (/ x B))
             (+ t_0 (/ 1.0 B)))))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1.65e-284) {
		tmp = ((F * sqrt(0.5)) / sin(B)) - (x / B);
	} else if (F <= 5.4e-254) {
		tmp = t_0 + ((F / B) * (1.0 / F));
	} else if (F <= 1.4) {
		tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
	} else if (F <= 6e+154) {
		tmp = (1.0 / sin(B)) - (x / B);
	} else {
		tmp = t_0 + (1.0 / 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 * ((-1.0d0) / tan(b))
    if (f <= (-1.4d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1.65d-284)) then
        tmp = ((f * sqrt(0.5d0)) / sin(b)) - (x / b)
    else if (f <= 5.4d-254) then
        tmp = t_0 + ((f / b) * (1.0d0 / f))
    else if (f <= 1.4d0) then
        tmp = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
    else if (f <= 6d+154) then
        tmp = (1.0d0 / sin(b)) - (x / b)
    else
        tmp = t_0 + (1.0d0 / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / Math.tan(B));
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1.65e-284) {
		tmp = ((F * Math.sqrt(0.5)) / Math.sin(B)) - (x / B);
	} else if (F <= 5.4e-254) {
		tmp = t_0 + ((F / B) * (1.0 / F));
	} else if (F <= 1.4) {
		tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
	} else if (F <= 6e+154) {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = t_0 + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (-1.0 / math.tan(B))
	tmp = 0
	if F <= -1.4:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1.65e-284:
		tmp = ((F * math.sqrt(0.5)) / math.sin(B)) - (x / B)
	elif F <= 5.4e-254:
		tmp = t_0 + ((F / B) * (1.0 / F))
	elif F <= 1.4:
		tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B)
	elif F <= 6e+154:
		tmp = (1.0 / math.sin(B)) - (x / B)
	else:
		tmp = t_0 + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B)))
	tmp = 0.0
	if (F <= -1.4)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1.65e-284)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - Float64(x / B));
	elseif (F <= 5.4e-254)
		tmp = Float64(t_0 + Float64(Float64(F / B) * Float64(1.0 / F)));
	elseif (F <= 1.4)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B));
	elseif (F <= 6e+154)
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	else
		tmp = Float64(t_0 + Float64(1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (-1.0 / tan(B));
	tmp = 0.0;
	if (F <= -1.4)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1.65e-284)
		tmp = ((F * sqrt(0.5)) / sin(B)) - (x / B);
	elseif (F <= 5.4e-254)
		tmp = t_0 + ((F / B) * (1.0 / F));
	elseif (F <= 1.4)
		tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
	elseif (F <= 6e+154)
		tmp = (1.0 / sin(B)) - (x / B);
	else
		tmp = t_0 + (1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.65e-284], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.4e-254], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e+154], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1.65 \cdot 10^{-284}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 5.4 \cdot 10^{-254}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \frac{1}{F}\\

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 6 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -1.3999999999999999

    1. Initial program 56.1%

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

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6498.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified98.7%

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

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) + \frac{-1}{\sin B} \]
    7. Step-by-step derivation
      1. lower-/.f6475.3

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    8. Simplified75.3%

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

    if -1.3999999999999999 < F < -1.65000000000000004e-284

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + \frac{\color{blue}{\sqrt{\frac{1}{2}}} \cdot F}{\sin B} \]
      5. lower-sin.f6480.4

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{\sqrt{0.5} \cdot F}{\color{blue}{\sin B}} \]
    11. Simplified80.4%

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

    if -1.65000000000000004e-284 < F < 5.40000000000000013e-254

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    7. Step-by-step derivation
      1. lower-/.f6493.6

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    8. Simplified93.6%

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

    if 5.40000000000000013e-254 < F < 1.3999999999999999

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2}}}}{\sin B} \]
    10. Step-by-step derivation
      1. lower-sqrt.f6484.2

        \[\leadsto \left(-\frac{x}{B}\right) + F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} \]
    11. Simplified84.2%

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

    if 1.3999999999999999 < F < 6.00000000000000052e154

    1. Initial program 94.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
      2. lower-sin.f6484.2

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{1}{\color{blue}{\sin B}} \]
    11. Simplified84.2%

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

    if 6.00000000000000052e154 < F

    1. Initial program 43.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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    8. Simplified84.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.65 \cdot 10^{-284}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{-254}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 71.8% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{-294}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-278}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))
   (if (<= F -1.4)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -2.5e-294)
       (- (/ (* F (sqrt 0.5)) (sin B)) (/ x B))
       (if (<= F 3.6e-278)
         t_0
         (if (<= F 1.4)
           (- (* F (/ (sqrt 0.5) (sin B))) (/ x B))
           (if (<= F 6e+154) (- (/ 1.0 (sin B)) (/ x B)) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = (x * (-1.0 / tan(B))) + (1.0 / B);
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -2.5e-294) {
		tmp = ((F * sqrt(0.5)) / sin(B)) - (x / B);
	} else if (F <= 3.6e-278) {
		tmp = t_0;
	} else if (F <= 1.4) {
		tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
	} else if (F <= 6e+154) {
		tmp = (1.0 / sin(B)) - (x / B);
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
    if (f <= (-1.4d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-2.5d-294)) then
        tmp = ((f * sqrt(0.5d0)) / sin(b)) - (x / b)
    else if (f <= 3.6d-278) then
        tmp = t_0
    else if (f <= 1.4d0) then
        tmp = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
    else if (f <= 6d+154) then
        tmp = (1.0d0 / sin(b)) - (x / b)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -2.5e-294) {
		tmp = ((F * Math.sqrt(0.5)) / Math.sin(B)) - (x / B);
	} else if (F <= 3.6e-278) {
		tmp = t_0;
	} else if (F <= 1.4) {
		tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
	} else if (F <= 6e+154) {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	tmp = 0
	if F <= -1.4:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -2.5e-294:
		tmp = ((F * math.sqrt(0.5)) / math.sin(B)) - (x / B)
	elif F <= 3.6e-278:
		tmp = t_0
	elif F <= 1.4:
		tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B)
	elif F <= 6e+154:
		tmp = (1.0 / math.sin(B)) - (x / B)
	else:
		tmp = t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B))
	tmp = 0.0
	if (F <= -1.4)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -2.5e-294)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - Float64(x / B));
	elseif (F <= 3.6e-278)
		tmp = t_0;
	elseif (F <= 1.4)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B));
	elseif (F <= 6e+154)
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (x * (-1.0 / tan(B))) + (1.0 / B);
	tmp = 0.0;
	if (F <= -1.4)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -2.5e-294)
		tmp = ((F * sqrt(0.5)) / sin(B)) - (x / B);
	elseif (F <= 3.6e-278)
		tmp = t_0;
	elseif (F <= 1.4)
		tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
	elseif (F <= 6e+154)
		tmp = (1.0 / sin(B)) - (x / B);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.5e-294], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.6e-278], t$95$0, If[LessEqual[F, 1.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e+154], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -2.5 \cdot 10^{-294}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 3.6 \cdot 10^{-278}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 6 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -1.3999999999999999

    1. Initial program 56.1%

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

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6498.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified98.7%

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

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) + \frac{-1}{\sin B} \]
    7. Step-by-step derivation
      1. lower-/.f6475.3

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    8. Simplified75.3%

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

    if -1.3999999999999999 < F < -2.5000000000000001e-294

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + \frac{\color{blue}{\sqrt{\frac{1}{2}}} \cdot F}{\sin B} \]
      5. lower-sin.f6480.4

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{\sqrt{0.5} \cdot F}{\color{blue}{\sin B}} \]
    11. Simplified80.4%

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

    if -2.5000000000000001e-294 < F < 3.59999999999999996e-278 or 6.00000000000000052e154 < F

    1. Initial program 58.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{1}{B}} \]
    7. Step-by-step derivation
      1. lower-/.f6484.4

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    8. Simplified84.4%

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

    if 3.59999999999999996e-278 < F < 1.3999999999999999

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2}}}}{\sin B} \]
    10. Step-by-step derivation
      1. lower-sqrt.f6480.7

        \[\leadsto \left(-\frac{x}{B}\right) + F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} \]
    11. Simplified80.7%

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

    if 1.3999999999999999 < F < 6.00000000000000052e154

    1. Initial program 94.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
      2. lower-sin.f6484.2

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{1}{\color{blue}{\sin B}} \]
    11. Simplified84.2%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification80.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{-294}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-278}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 71.8% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ t_1 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{-294}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-278}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (* F (/ (sqrt 0.5) (sin B))) (/ x B)))
        (t_1 (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))
   (if (<= F -1.4)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -2.5e-294)
       t_0
       (if (<= F 3.6e-278)
         t_1
         (if (<= F 1.4)
           t_0
           (if (<= F 6e+154) (- (/ 1.0 (sin B)) (/ x B)) t_1)))))))
double code(double F, double B, double x) {
	double t_0 = (F * (sqrt(0.5) / sin(B))) - (x / B);
	double t_1 = (x * (-1.0 / tan(B))) + (1.0 / B);
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -2.5e-294) {
		tmp = t_0;
	} else if (F <= 3.6e-278) {
		tmp = t_1;
	} else if (F <= 1.4) {
		tmp = t_0;
	} else if (F <= 6e+154) {
		tmp = (1.0 / sin(B)) - (x / B);
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
    t_1 = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
    if (f <= (-1.4d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-2.5d-294)) then
        tmp = t_0
    else if (f <= 3.6d-278) then
        tmp = t_1
    else if (f <= 1.4d0) then
        tmp = t_0
    else if (f <= 6d+154) then
        tmp = (1.0d0 / sin(b)) - (x / b)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
	double t_1 = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	double tmp;
	if (F <= -1.4) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -2.5e-294) {
		tmp = t_0;
	} else if (F <= 3.6e-278) {
		tmp = t_1;
	} else if (F <= 1.4) {
		tmp = t_0;
	} else if (F <= 6e+154) {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B)
	t_1 = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	tmp = 0
	if F <= -1.4:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -2.5e-294:
		tmp = t_0
	elif F <= 3.6e-278:
		tmp = t_1
	elif F <= 1.4:
		tmp = t_0
	elif F <= 6e+154:
		tmp = (1.0 / math.sin(B)) - (x / B)
	else:
		tmp = t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B))
	t_1 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B))
	tmp = 0.0
	if (F <= -1.4)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -2.5e-294)
		tmp = t_0;
	elseif (F <= 3.6e-278)
		tmp = t_1;
	elseif (F <= 1.4)
		tmp = t_0;
	elseif (F <= 6e+154)
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (F * (sqrt(0.5) / sin(B))) - (x / B);
	t_1 = (x * (-1.0 / tan(B))) + (1.0 / B);
	tmp = 0.0;
	if (F <= -1.4)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -2.5e-294)
		tmp = t_0;
	elseif (F <= 3.6e-278)
		tmp = t_1;
	elseif (F <= 1.4)
		tmp = t_0;
	elseif (F <= 6e+154)
		tmp = (1.0 / sin(B)) - (x / B);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.5e-294], t$95$0, If[LessEqual[F, 3.6e-278], t$95$1, If[LessEqual[F, 1.4], t$95$0, If[LessEqual[F, 6e+154], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\
t_1 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -2.5 \cdot 10^{-294}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 3.6 \cdot 10^{-278}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 6 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.3999999999999999

    1. Initial program 56.1%

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

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6498.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified98.7%

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

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) + \frac{-1}{\sin B} \]
    7. Step-by-step derivation
      1. lower-/.f6475.3

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    8. Simplified75.3%

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

    if -1.3999999999999999 < F < -2.5000000000000001e-294 or 3.59999999999999996e-278 < F < 1.3999999999999999

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2}}}}{\sin B} \]
    10. Step-by-step derivation
      1. lower-sqrt.f6480.5

        \[\leadsto \left(-\frac{x}{B}\right) + F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} \]
    11. Simplified80.5%

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

    if -2.5000000000000001e-294 < F < 3.59999999999999996e-278 or 6.00000000000000052e154 < F

    1. Initial program 58.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{1}{B}} \]
    7. Step-by-step derivation
      1. lower-/.f6484.4

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    8. Simplified84.4%

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

    if 1.3999999999999999 < F < 6.00000000000000052e154

    1. Initial program 94.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
      2. lower-sin.f6484.2

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{1}{\color{blue}{\sin B}} \]
    11. Simplified84.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{-294}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-278}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 55.0% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{if}\;B \leq 0.106:\\
\;\;\;\;F \cdot \frac{\mathsf{fma}\left(t\_0, \mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right), \left(t\_0 \cdot \mathsf{fma}\left(B \cdot B, 0.00205026455026455, 0.019444444444444445\right)\right) \cdot \left(\left(B \cdot B\right) \cdot \left(B \cdot B\right)\right)\right)}{B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 0.105999999999999997

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \color{blue}{\frac{\sqrt{\frac{1}{2 + {F}^{2}}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} + {B}^{2} \cdot \left(\frac{31}{15120} \cdot \left({B}^{2} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right) + \frac{7}{360} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)\right)}{B}} \]
    11. Simplified57.0%

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

    if 0.105999999999999997 < B

    1. Initial program 84.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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    8. Simplified43.3%

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

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

Alternative 13: 55.0% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.076:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(t\_0 \cdot \left(B \cdot B\right)\right) \cdot \mathsf{fma}\left(B \cdot B, F \cdot 0.019444444444444445, F \cdot 0.16666666666666666\right)\right)}{B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 0.0759999999999999981

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(-1 \cdot \left(\left({B}^{2} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}{B}} \]
    5. Simplified61.2%

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

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

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

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

    if 0.0759999999999999981 < B

    1. Initial program 84.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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    8. Simplified43.3%

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

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

Alternative 14: 64.7% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -90:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7.4 \cdot 10^{-10}:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -90.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 7.4e-10)
     (-
      (*
       F
       (/
        (* (sqrt (/ 1.0 (fma F F 2.0))) (fma 0.16666666666666666 (* B B) 1.0))
        B))
      (/ x B))
     (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -90.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 7.4e-10) {
		tmp = (F * ((sqrt((1.0 / fma(F, F, 2.0))) * fma(0.16666666666666666, (B * B), 1.0)) / B)) - (x / B);
	} else {
		tmp = (1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -90.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 7.4e-10)
		tmp = Float64(Float64(F * Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * fma(0.16666666666666666, Float64(B * B), 1.0)) / B)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -90.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.4e-10], N[(N[(F * N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -90:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 7.4 \cdot 10^{-10}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)}{B} - \frac{x}{B}\\

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


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

    1. Initial program 55.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.5%

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

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) + \frac{-1}{\sin B} \]
    7. Step-by-step derivation
      1. lower-/.f6475.9

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    8. Simplified75.9%

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

    if -90 < F < 7.4000000000000003e-10

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \color{blue}{\frac{\sqrt{\frac{1}{2 + {F}^{2}}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)}{B}} \]
    11. Simplified51.9%

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

    if 7.4000000000000003e-10 < F

    1. Initial program 68.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + \color{blue}{\frac{1}{\sin B}} \]
      2. lower-sin.f6471.5

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{1}{\color{blue}{\sin B}} \]
    11. Simplified71.5%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.3%

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

Alternative 15: 55.1% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{if}\;B \leq 0.076:\\
\;\;\;\;F \cdot \frac{\mathsf{fma}\left(B \cdot B, t\_0 \cdot \mathsf{fma}\left(B \cdot B, 0.019444444444444445, 0.16666666666666666\right), t\_0\right)}{B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 0.0759999999999999981

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \color{blue}{\frac{\sqrt{\frac{1}{2 + {F}^{2}}} + {B}^{2} \cdot \left(\frac{7}{360} \cdot \left({B}^{2} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right) + \frac{1}{6} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)}{B}} \]
    11. Simplified57.0%

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

    if 0.0759999999999999981 < B

    1. Initial program 84.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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    8. Simplified43.3%

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

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

Alternative 16: 58.0% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -90:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{+35}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.009523809523809525, x \cdot -0.007407407407407408\right), x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), 1 - x\right)}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -90.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 9.5e+35)
     (- (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F B)) (/ x B))
     (/
      (fma
       (* B B)
       (fma
        (* B B)
        (fma
         (* B B)
         (fma x 0.009523809523809525 (* x -0.007407407407407408))
         (* x 0.022222222222222223))
        (* x 0.3333333333333333))
       (- 1.0 x))
      B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -90.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 9.5e+35) {
		tmp = (sqrt((1.0 / fma(F, F, 2.0))) * (F / B)) - (x / B);
	} else {
		tmp = fma((B * B), fma((B * B), fma((B * B), fma(x, 0.009523809523809525, (x * -0.007407407407407408)), (x * 0.022222222222222223)), (x * 0.3333333333333333)), (1.0 - x)) / B;
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -90.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 9.5e+35)
		tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / B)) - Float64(x / B));
	else
		tmp = Float64(fma(Float64(B * B), fma(Float64(B * B), fma(Float64(B * B), fma(x, 0.009523809523809525, Float64(x * -0.007407407407407408)), Float64(x * 0.022222222222222223)), Float64(x * 0.3333333333333333)), Float64(1.0 - x)) / B);
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -90.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.5e+35], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(B * B), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(x * 0.009523809523809525 + N[(x * -0.007407407407407408), $MachinePrecision]), $MachinePrecision] + N[(x * 0.022222222222222223), $MachinePrecision]), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -90:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 9.5 \cdot 10^{+35}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.009523809523809525, x \cdot -0.007407407407407408\right), x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), 1 - x\right)}{B}\\


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

    1. Initial program 55.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.5%

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

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) + \frac{-1}{\sin B} \]
    7. Step-by-step derivation
      1. lower-/.f6475.9

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    8. Simplified75.9%

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

    if -90 < F < 9.50000000000000062e35

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000062e35 < F

    1. Initial program 64.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    7. Step-by-step derivation
      1. lower-/.f6451.8

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    8. Simplified51.8%

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

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

        \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right) - x}{B}} \]
    11. Simplified44.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.009523809523809525, x \cdot -0.007407407407407408\right), x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), 1 - x\right)}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification56.4%

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

Alternative 17: 50.8% accurate, 4.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -100000000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{+35}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.009523809523809525, x \cdot -0.007407407407407408\right), x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), 1 - x\right)}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -100000000.0)
   (/ (- -1.0 x) B)
   (if (<= F 9.5e+35)
     (- (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F B)) (/ x B))
     (/
      (fma
       (* B B)
       (fma
        (* B B)
        (fma
         (* B B)
         (fma x 0.009523809523809525 (* x -0.007407407407407408))
         (* x 0.022222222222222223))
        (* x 0.3333333333333333))
       (- 1.0 x))
      B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -100000000.0) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 9.5e+35) {
		tmp = (sqrt((1.0 / fma(F, F, 2.0))) * (F / B)) - (x / B);
	} else {
		tmp = fma((B * B), fma((B * B), fma((B * B), fma(x, 0.009523809523809525, (x * -0.007407407407407408)), (x * 0.022222222222222223)), (x * 0.3333333333333333)), (1.0 - x)) / B;
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -100000000.0)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 9.5e+35)
		tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / B)) - Float64(x / B));
	else
		tmp = Float64(fma(Float64(B * B), fma(Float64(B * B), fma(Float64(B * B), fma(x, 0.009523809523809525, Float64(x * -0.007407407407407408)), Float64(x * 0.022222222222222223)), Float64(x * 0.3333333333333333)), Float64(1.0 - x)) / B);
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -100000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.5e+35], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(B * B), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(x * 0.009523809523809525 + N[(x * -0.007407407407407408), $MachinePrecision]), $MachinePrecision] + N[(x * 0.022222222222222223), $MachinePrecision]), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -100000000:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 9.5 \cdot 10^{+35}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.009523809523809525, x \cdot -0.007407407407407408\right), x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), 1 - x\right)}{B}\\


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

    1. Initial program 55.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.5%

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6455.9

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified55.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} - \frac{1}{B} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} - \frac{1}{B} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(x\right)\right) - 1}{B}} \]
      4. sub-negN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}}{B} \]
      5. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x + 1\right)\right)}}{B} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(1 + x\right)}\right)}{B} \]
      7. mul-1-negN/A

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      9. distribute-lft-inN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      10. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      11. mul-1-negN/A

        \[\leadsto \frac{-1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      12. unsub-negN/A

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
      13. lower--.f6455.9

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    11. Simplified55.9%

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

    if -1e8 < F < 9.50000000000000062e35

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000062e35 < F

    1. Initial program 64.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    7. Step-by-step derivation
      1. lower-/.f6451.8

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    8. Simplified51.8%

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

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

        \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right)\right) - x}{B}} \]
    11. Simplified44.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.009523809523809525, x \cdot -0.007407407407407408\right), x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), 1 - x\right)}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -100000000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{+35}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.009523809523809525, x \cdot -0.007407407407407408\right), x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), 1 - x\right)}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 50.8% accurate, 4.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -100000000:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 9.5 \cdot 10^{+35}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, -0.0021164021164021165, -0.022222222222222223\right), -0.3333333333333333\right), 1\right)}{B}\\


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

    1. Initial program 55.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.5%

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6455.9

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified55.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} - \frac{1}{B} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} - \frac{1}{B} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(x\right)\right) - 1}{B}} \]
      4. sub-negN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}}{B} \]
      5. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x + 1\right)\right)}}{B} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(1 + x\right)}\right)}{B} \]
      7. mul-1-negN/A

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      9. distribute-lft-inN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      10. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      11. mul-1-negN/A

        \[\leadsto \frac{-1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      12. unsub-negN/A

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
      13. lower--.f6455.9

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    11. Simplified55.9%

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

    if -1e8 < F < 9.50000000000000062e35

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000062e35 < F

    1. Initial program 64.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    7. Step-by-step derivation
      1. lower-/.f6451.8

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    8. Simplified51.8%

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{\mathsf{fma}\left(\color{blue}{B \cdot B}, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right)\right) + \frac{F}{B} \cdot \frac{1}{F} \]
      6. sub-negN/A

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(\color{blue}{B \cdot B}, \frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}, \frac{-1}{3}\right), 1\right)}{B}\right)\right) + \frac{F}{B} \cdot \frac{1}{F} \]
      11. sub-negN/A

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(\color{blue}{B \cdot B}, \frac{-2}{945}, \frac{-1}{45}\right), \frac{-1}{3}\right), 1\right)}{B}\right)\right) + \frac{F}{B} \cdot \frac{1}{F} \]
      16. lower-*.f6425.1

        \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(\color{blue}{B \cdot B}, -0.0021164021164021165, -0.022222222222222223\right), -0.3333333333333333\right), 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{F} \]
    11. Simplified25.1%

      \[\leadsto \left(-x \cdot \color{blue}{\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, -0.0021164021164021165, -0.022222222222222223\right), -0.3333333333333333\right), 1\right)}{B}}\right) + \frac{F}{B} \cdot \frac{1}{F} \]
    12. Taylor expanded in F around 0

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \frac{-2}{945}, \frac{-1}{45}\right), \frac{-1}{3}\right), 1\right)}{B}\right)\right) + \color{blue}{\frac{1}{B}} \]
    13. Step-by-step derivation
      1. lower-/.f6444.4

        \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, -0.0021164021164021165, -0.022222222222222223\right), -0.3333333333333333\right), 1\right)}{B}\right) + \color{blue}{\frac{1}{B}} \]
    14. Simplified44.4%

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

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

Alternative 19: 50.8% accurate, 5.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -100000000:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 9.5 \cdot 10^{+35}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot \mathsf{fma}\left(B, B \cdot \left(x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), B, 1 - x\right)}{B}\\


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

    1. Initial program 55.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.5%

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6455.9

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified55.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} - \frac{1}{B} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} - \frac{1}{B} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(x\right)\right) - 1}{B}} \]
      4. sub-negN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}}{B} \]
      5. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x + 1\right)\right)}}{B} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(1 + x\right)}\right)}{B} \]
      7. mul-1-negN/A

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      9. distribute-lft-inN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      10. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      11. mul-1-negN/A

        \[\leadsto \frac{-1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      12. unsub-negN/A

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
      13. lower--.f6455.9

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    11. Simplified55.9%

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

    if -1e8 < F < 9.50000000000000062e35

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000062e35 < F

    1. Initial program 64.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    7. Step-by-step derivation
      1. lower-/.f6451.8

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    8. Simplified51.8%

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

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

        \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right) - x}{B}} \]
    11. Simplified44.3%

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

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

Alternative 20: 50.9% accurate, 5.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -300000000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{+36}:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot \mathsf{fma}\left(B, B \cdot \left(x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), B, 1 - x\right)}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -300000000.0)
   (/ (- -1.0 x) B)
   (if (<= F 2.4e+36)
     (- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) B)) (/ x B))
     (/
      (fma
       (* B (fma B (* B (* x 0.022222222222222223)) (* x 0.3333333333333333)))
       B
       (- 1.0 x))
      B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -300000000.0) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.4e+36) {
		tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / B)) - (x / B);
	} else {
		tmp = fma((B * fma(B, (B * (x * 0.022222222222222223)), (x * 0.3333333333333333))), B, (1.0 - x)) / B;
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -300000000.0)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 2.4e+36)
		tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / B)) - Float64(x / B));
	else
		tmp = Float64(fma(Float64(B * fma(B, Float64(B * Float64(x * 0.022222222222222223)), Float64(x * 0.3333333333333333))), B, Float64(1.0 - x)) / B);
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -300000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.4e+36], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(B * N[(B * N[(B * N[(x * 0.022222222222222223), $MachinePrecision]), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * B + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -300000000:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{+36}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot \mathsf{fma}\left(B, B \cdot \left(x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), B, 1 - x\right)}{B}\\


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

    1. Initial program 54.9%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified99.6%

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6456.6

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified56.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} - \frac{1}{B} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} - \frac{1}{B} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(x\right)\right) - 1}{B}} \]
      4. sub-negN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}}{B} \]
      5. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x + 1\right)\right)}}{B} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(1 + x\right)}\right)}{B} \]
      7. mul-1-negN/A

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      9. distribute-lft-inN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      10. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      11. mul-1-negN/A

        \[\leadsto \frac{-1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      12. unsub-negN/A

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
      13. lower--.f6456.6

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    11. Simplified56.6%

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

    if -3e8 < F < 2.39999999999999992e36

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      8. unpow2N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
      9. lower-fma.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
      10. lower-sin.f6499.4

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\color{blue}{\sin B}} \]
    5. Simplified99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) + F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
    7. Step-by-step derivation
      1. lower-/.f6474.0

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
    8. Simplified74.0%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
    9. Taylor expanded in B around 0

      \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} \]
    10. Step-by-step derivation
      1. associate-*l/N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} \]
      2. *-lft-identityN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} \]
      3. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \color{blue}{\frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{B}} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} \]
      5. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \frac{\sqrt{\color{blue}{\frac{1}{2 + {F}^{2}}}}}{B} \]
      6. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} \]
      7. unpow2N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) + F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} \]
      8. lower-fma.f6450.7

        \[\leadsto \left(-\frac{x}{B}\right) + F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} \]
    11. Simplified50.7%

      \[\leadsto \left(-\frac{x}{B}\right) + F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{B}} \]

    if 2.39999999999999992e36 < F

    1. Initial program 64.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 \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      4. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \]
      6. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}} \]
      7. associate-+l+N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}} \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, 2 + {F}^{2}\right)}}} \]
      9. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{{F}^{2} + 2}\right)}} \]
      10. unpow2N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F} + 2\right)}} \]
      11. lower-fma.f6444.5

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}} \]
    5. Simplified44.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} \]
    6. Taylor expanded in F around inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    7. Step-by-step derivation
      1. lower-/.f6451.8

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    8. Simplified51.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    9. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right) - x}{B}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right) - x}{B}} \]
    11. Simplified44.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(B, B \cdot \left(x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right) \cdot B, B, 1 - x\right)}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -300000000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{+36}:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot \mathsf{fma}\left(B, B \cdot \left(x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), B, 1 - x\right)}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 43.2% accurate, 6.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.26 \cdot 10^{-21}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot \mathsf{fma}\left(B, B \cdot \left(x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), B, 1 - x\right)}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -9.5e-121)
   (/ (- -1.0 x) B)
   (if (<= F 1.26e-21)
     (- (/ x B))
     (/
      (fma
       (* B (fma B (* B (* x 0.022222222222222223)) (* x 0.3333333333333333)))
       B
       (- 1.0 x))
      B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.5e-121) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.26e-21) {
		tmp = -(x / B);
	} else {
		tmp = fma((B * fma(B, (B * (x * 0.022222222222222223)), (x * 0.3333333333333333))), B, (1.0 - x)) / B;
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -9.5e-121)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 1.26e-21)
		tmp = Float64(-Float64(x / B));
	else
		tmp = Float64(fma(Float64(B * fma(B, Float64(B * Float64(x * 0.022222222222222223)), Float64(x * 0.3333333333333333))), B, Float64(1.0 - x)) / B);
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -9.5e-121], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.26e-21], (-N[(x / B), $MachinePrecision]), N[(N[(N[(B * N[(B * N[(B * N[(x * 0.022222222222222223), $MachinePrecision]), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * B + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 1.26 \cdot 10^{-21}:\\
\;\;\;\;-\frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot \mathsf{fma}\left(B, B \cdot \left(x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), B, 1 - x\right)}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -9.4999999999999994e-121

    1. Initial program 63.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6488.3

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified88.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6452.4

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified52.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} - \frac{1}{B} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} - \frac{1}{B} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(x\right)\right) - 1}{B}} \]
      4. sub-negN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}}{B} \]
      5. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x + 1\right)\right)}}{B} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(1 + x\right)}\right)}{B} \]
      7. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(1 + x\right)}}{B} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      9. distribute-lft-inN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      10. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      11. mul-1-negN/A

        \[\leadsto \frac{-1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      12. unsub-negN/A

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
      13. lower--.f6452.4

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    11. Simplified52.4%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -9.4999999999999994e-121 < F < 1.26e-21

    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 F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6432.3

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified32.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6416.2

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified16.2%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around inf

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{B} \]
    10. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} \]
      2. lower-neg.f6429.1

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified29.1%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]

    if 1.26e-21 < F

    1. Initial program 69.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      4. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \]
      6. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}} \]
      7. associate-+l+N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}} \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, 2 + {F}^{2}\right)}}} \]
      9. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{{F}^{2} + 2}\right)}} \]
      10. unpow2N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F} + 2\right)}} \]
      11. lower-fma.f6445.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}} \]
    5. Simplified45.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} \]
    6. Taylor expanded in F around inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    7. Step-by-step derivation
      1. lower-/.f6450.5

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    8. Simplified50.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    9. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right) - x}{B}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right) - x}{B}} \]
    11. Simplified42.8%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(B, B \cdot \left(x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right) \cdot B, B, 1 - x\right)}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification41.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.26 \cdot 10^{-21}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot \mathsf{fma}\left(B, B \cdot \left(x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), B, 1 - x\right)}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 43.0% accurate, 8.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.3 \cdot 10^{-111}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, x \cdot 0.3333333333333333, 1\right) - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -9.5e-121)
   (/ (- -1.0 x) B)
   (if (<= F 3.3e-111)
     (- (/ x B))
     (/ (- (fma (* B B) (* x 0.3333333333333333) 1.0) x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.5e-121) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.3e-111) {
		tmp = -(x / B);
	} else {
		tmp = (fma((B * B), (x * 0.3333333333333333), 1.0) - x) / B;
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -9.5e-121)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 3.3e-111)
		tmp = Float64(-Float64(x / B));
	else
		tmp = Float64(Float64(fma(Float64(B * B), Float64(x * 0.3333333333333333), 1.0) - x) / B);
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -9.5e-121], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.3e-111], (-N[(x / B), $MachinePrecision]), N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 3.3 \cdot 10^{-111}:\\
\;\;\;\;-\frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, x \cdot 0.3333333333333333, 1\right) - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -9.4999999999999994e-121

    1. Initial program 63.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6488.3

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified88.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6452.4

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified52.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} - \frac{1}{B} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} - \frac{1}{B} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(x\right)\right) - 1}{B}} \]
      4. sub-negN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}}{B} \]
      5. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x + 1\right)\right)}}{B} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(1 + x\right)}\right)}{B} \]
      7. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(1 + x\right)}}{B} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      9. distribute-lft-inN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      10. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      11. mul-1-negN/A

        \[\leadsto \frac{-1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      12. unsub-negN/A

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
      13. lower--.f6452.4

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    11. Simplified52.4%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -9.4999999999999994e-121 < F < 3.3e-111

    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 F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6439.0

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified39.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6419.8

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified19.8%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around inf

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{B} \]
    10. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} \]
      2. lower-neg.f6435.9

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified35.9%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]

    if 3.3e-111 < F

    1. Initial program 76.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      4. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \]
      6. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}} \]
      7. associate-+l+N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}} \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, 2 + {F}^{2}\right)}}} \]
      9. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{{F}^{2} + 2}\right)}} \]
      10. unpow2N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F} + 2\right)}} \]
      11. lower-fma.f6451.2

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}} \]
    5. Simplified51.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} \]
    6. Taylor expanded in F around inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    7. Step-by-step derivation
      1. lower-/.f6442.8

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    8. Simplified42.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    9. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{\left(1 + \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right) - x}{B}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(1 + \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right) - x}{B}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\left(1 + \color{blue}{\left({B}^{2} \cdot x\right) \cdot \frac{1}{3}}\right) - x}{B} \]
      3. associate-*r*N/A

        \[\leadsto \frac{\left(1 + \color{blue}{{B}^{2} \cdot \left(x \cdot \frac{1}{3}\right)}\right) - x}{B} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\left(1 + {B}^{2} \cdot \color{blue}{\left(\frac{1}{3} \cdot x\right)}\right) - x}{B} \]
      5. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{\left(1 + {B}^{2} \cdot \left(\frac{1}{3} \cdot x\right)\right) - x}}{B} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left({B}^{2} \cdot \left(\frac{1}{3} \cdot x\right) + 1\right)} - x}{B} \]
      7. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left({B}^{2}, \frac{1}{3} \cdot x, 1\right)} - x}{B} \]
      8. unpow2N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{B \cdot B}, \frac{1}{3} \cdot x, 1\right) - x}{B} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{B \cdot B}, \frac{1}{3} \cdot x, 1\right) - x}{B} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(B \cdot B, \color{blue}{x \cdot \frac{1}{3}}, 1\right) - x}{B} \]
      11. lower-*.f6434.7

        \[\leadsto \frac{\mathsf{fma}\left(B \cdot B, \color{blue}{x \cdot 0.3333333333333333}, 1\right) - x}{B} \]
    11. Simplified34.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(B \cdot B, x \cdot 0.3333333333333333, 1\right) - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification41.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.3 \cdot 10^{-111}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, x \cdot 0.3333333333333333, 1\right) - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 43.0% accurate, 13.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.3 \cdot 10^{-111}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -9.5e-121)
   (/ (- -1.0 x) B)
   (if (<= F 3.3e-111) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.5e-121) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.3e-111) {
		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 <= (-9.5d-121)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 3.3d-111) 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 <= -9.5e-121) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.3e-111) {
		tmp = -(x / B);
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -9.5e-121:
		tmp = (-1.0 - x) / B
	elif F <= 3.3e-111:
		tmp = -(x / B)
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -9.5e-121)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 3.3e-111)
		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 <= -9.5e-121)
		tmp = (-1.0 - x) / B;
	elseif (F <= 3.3e-111)
		tmp = -(x / B);
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -9.5e-121], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.3e-111], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 3.3 \cdot 10^{-111}:\\
\;\;\;\;-\frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -9.4999999999999994e-121

    1. Initial program 63.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6488.3

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified88.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6452.4

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified52.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} - \frac{1}{B} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} - \frac{1}{B} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(x\right)\right) - 1}{B}} \]
      4. sub-negN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}}{B} \]
      5. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x + 1\right)\right)}}{B} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(1 + x\right)}\right)}{B} \]
      7. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(1 + x\right)}}{B} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      9. distribute-lft-inN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      10. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      11. mul-1-negN/A

        \[\leadsto \frac{-1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      12. unsub-negN/A

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
      13. lower--.f6452.4

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    11. Simplified52.4%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -9.4999999999999994e-121 < F < 3.3e-111

    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 F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6439.0

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified39.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6419.8

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified19.8%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around inf

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{B} \]
    10. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} \]
      2. lower-neg.f6435.9

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified35.9%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]

    if 3.3e-111 < F

    1. Initial program 76.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      4. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \]
      6. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}} \]
      7. associate-+l+N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}} \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, 2 + {F}^{2}\right)}}} \]
      9. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{{F}^{2} + 2}\right)}} \]
      10. unpow2N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F} + 2\right)}} \]
      11. lower-fma.f6451.2

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}} \]
    5. Simplified51.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} \]
    6. Taylor expanded in F around inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    7. Step-by-step derivation
      1. lower-/.f6442.8

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    8. Simplified42.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    9. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
      2. lower--.f6434.3

        \[\leadsto \frac{\color{blue}{1 - x}}{B} \]
    11. Simplified34.3%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification40.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.3 \cdot 10^{-111}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 30.0% accurate, 14.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{x}{B}\\ \mathbf{if}\;x \leq -1 \cdot 10^{-259}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ x B))))
   (if (<= x -1e-259) t_0 (if (<= x 3.1e-21) (/ -1.0 B) t_0))))
double code(double F, double B, double x) {
	double t_0 = -(x / B);
	double tmp;
	if (x <= -1e-259) {
		tmp = t_0;
	} else if (x <= 3.1e-21) {
		tmp = -1.0 / B;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = -(x / b)
    if (x <= (-1d-259)) then
        tmp = t_0
    else if (x <= 3.1d-21) then
        tmp = (-1.0d0) / b
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -(x / B);
	double tmp;
	if (x <= -1e-259) {
		tmp = t_0;
	} else if (x <= 3.1e-21) {
		tmp = -1.0 / B;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -(x / B)
	tmp = 0
	if x <= -1e-259:
		tmp = t_0
	elif x <= 3.1e-21:
		tmp = -1.0 / B
	else:
		tmp = t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(-Float64(x / B))
	tmp = 0.0
	if (x <= -1e-259)
		tmp = t_0;
	elseif (x <= 3.1e-21)
		tmp = Float64(-1.0 / B);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -(x / B);
	tmp = 0.0;
	if (x <= -1e-259)
		tmp = t_0;
	elseif (x <= 3.1e-21)
		tmp = -1.0 / B;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[x, -1e-259], t$95$0, If[LessEqual[x, 3.1e-21], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-259}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 3.1 \cdot 10^{-21}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.0000000000000001e-259 or 3.0999999999999998e-21 < x

    1. Initial program 80.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6469.8

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified69.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6435.7

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified35.7%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around inf

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{B} \]
    10. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} \]
      2. lower-neg.f6437.5

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified37.5%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]

    if -1.0000000000000001e-259 < x < 3.0999999999999998e-21

    1. Initial program 73.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6429.6

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified29.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6421.6

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified21.6%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{-1}{B}} \]
    10. Step-by-step derivation
      1. lower-/.f6421.6

        \[\leadsto \color{blue}{\frac{-1}{B}} \]
    11. Simplified21.6%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-259}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 36.0% accurate, 17.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -9.5e-121) (/ (- -1.0 x) B) (- (/ x B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.5e-121) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -(x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-9.5d-121)) then
        tmp = ((-1.0d0) - x) / b
    else
        tmp = -(x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.5e-121) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -(x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -9.5e-121:
		tmp = (-1.0 - x) / B
	else:
		tmp = -(x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -9.5e-121)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(-Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -9.5e-121)
		tmp = (-1.0 - x) / B;
	else
		tmp = -(x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -9.5e-121], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;-\frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -9.4999999999999994e-121

    1. Initial program 63.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6488.3

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified88.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6452.4

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified52.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} - \frac{1}{B} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} - \frac{1}{B} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(x\right)\right) - 1}{B}} \]
      4. sub-negN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(1\right)\right)}}{B} \]
      5. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(x + 1\right)\right)}}{B} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(1 + x\right)}\right)}{B} \]
      7. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(1 + x\right)}}{B} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      9. distribute-lft-inN/A

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      10. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      11. mul-1-negN/A

        \[\leadsto \frac{-1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      12. unsub-negN/A

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
      13. lower--.f6452.4

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    11. Simplified52.4%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -9.4999999999999994e-121 < F

    1. Initial program 85.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6439.2

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified39.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6419.6

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified19.6%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around inf

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{B} \]
    10. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{B} \]
      2. lower-neg.f6426.9

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    11. Simplified26.9%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification35.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 17.5% accurate, 20.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 2 \cdot 10^{-108}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x) :precision binary64 (if (<= F 2e-108) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 2e-108) {
		tmp = -1.0 / B;
	} else {
		tmp = 1.0 / 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 <= 2d-108) then
        tmp = (-1.0d0) / b
    else
        tmp = 1.0d0 / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= 2e-108) {
		tmp = -1.0 / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 2e-108:
		tmp = -1.0 / B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 2e-108)
		tmp = Float64(-1.0 / B);
	else
		tmp = Float64(1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 2e-108)
		tmp = -1.0 / B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 2e-108], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 2 \cdot 10^{-108}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 2.00000000000000008e-108

    1. Initial program 79.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
      2. lower-sin.f6467.0

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
    5. Simplified67.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
      2. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
      4. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      5. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
      6. lower-+.f64N/A

        \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
      7. lower-neg.f6438.6

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    8. Simplified38.6%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    9. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{-1}{B}} \]
    10. Step-by-step derivation
      1. lower-/.f6415.9

        \[\leadsto \color{blue}{\frac{-1}{B}} \]
    11. Simplified15.9%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]

    if 2.00000000000000008e-108 < F

    1. Initial program 76.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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      4. lower-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\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(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \]
      6. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}} \]
      7. associate-+l+N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}} \]
      8. lower-fma.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, 2 + {F}^{2}\right)}}} \]
      9. +-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{{F}^{2} + 2}\right)}} \]
      10. unpow2N/A

        \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F} + 2\right)}} \]
      11. lower-fma.f6450.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}} \]
    5. Simplified50.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} \]
    6. Taylor expanded in F around inf

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    7. Step-by-step derivation
      1. lower-/.f6442.2

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    8. Simplified42.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    9. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{1}{B}} \]
    10. Step-by-step derivation
      1. lower-/.f6417.3

        \[\leadsto \color{blue}{\frac{1}{B}} \]
    11. Simplified17.3%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 27: 10.4% 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.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 F around -inf

    \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
  4. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{-1}{\sin B}} \]
    2. lower-sin.f6456.1

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
  5. Simplified56.1%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
  6. Taylor expanded in B around 0

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  7. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{1 + x}{B}\right)} \]
    2. distribute-neg-fracN/A

      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
    3. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B}} \]
    4. distribute-neg-inN/A

      \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
    5. metadata-evalN/A

      \[\leadsto \frac{\color{blue}{-1} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
    6. lower-+.f64N/A

      \[\leadsto \frac{\color{blue}{-1 + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
    7. lower-neg.f6430.9

      \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
  8. Simplified30.9%

    \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
  9. Taylor expanded in x around 0

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  10. Step-by-step derivation
    1. lower-/.f6410.8

      \[\leadsto \color{blue}{\frac{-1}{B}} \]
  11. Simplified10.8%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024215 
(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))))))