VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.1% → 99.7%
Time: 18.2s
Alternatives: 27
Speedup: 1.5×

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: 77.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.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 5.4 \cdot 10^{+28}:\\
\;\;\;\;\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\frac{\sin B}{F}} - t\_0\\

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


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

    1. Initial program 54.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified74.8%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    if -1.9999999999999999e35 < F < 5.4000000000000003e28

    1. Initial program 99.4%

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

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

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

        \[\leadsto \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)} - \color{blue}{\frac{x}{\tan B}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(\frac{x}{\tan B}\right)}\right) \]
    4. Applied egg-rr99.7%

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

    if 5.4000000000000003e28 < F

    1. Initial program 57.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified74.1%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

Alternative 2: 99.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 10^{+25}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}}}{\sin B} - t\_0\\

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


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

    1. Initial program 42.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified60.4%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    if -2.0000000000000001e152 < F < 1.00000000000000009e25

    1. Initial program 95.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.7%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.7%

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

    if 1.00000000000000009e25 < F

    1. Initial program 58.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified74.8%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

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

Alternative 3: 98.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 57.1%

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

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified76.3%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified98.9%

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

    if -1.3999999999999999 < F < 1.4199999999999999

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.7%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.7%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2}}\right)\right), \sin B\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\frac{1}{2}\right)\right), \sin B\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. sin-lowering-sin.f6499.1%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    10. Simplified99.1%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]

    if 1.4199999999999999 < F

    1. Initial program 62.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified77.1%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified98.5%

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

Alternative 4: 86.1% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -3 \cdot 10^{-103}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 2.35 \cdot 10^{-56}:\\
\;\;\;\;0 - t\_1\\

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

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


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

    1. Initial program 55.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified75.2%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    if -3.1e11 < F < -3e-103 or 2.35e-56 < F < 4.3e5

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(F, \color{blue}{\left(\frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\left(\sqrt{\frac{1}{2 + {F}^{2}}}\right), \color{blue}{\sin B}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \sin \color{blue}{B}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \sin B\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \sin B\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \sin B\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \sin B\right)\right) \]
      10. sin-lowering-sin.f6480.7%

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified80.7%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{\frac{1}{2 + F \cdot F}}}{\sin B}} \]
    6. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \frac{F \cdot \frac{\sqrt{1}}{\sqrt{2 + F \cdot F}}}{\sin B} \]
      3. metadata-evalN/A

        \[\leadsto \frac{F \cdot \frac{1}{\sqrt{2 + F \cdot F}}}{\sin B} \]
      4. unpow1/2N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\sin B \cdot \frac{{\left(2 + F \cdot F\right)}^{\frac{1}{2}}}{F}\right)}\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\sin B, \color{blue}{\left(\frac{{\left(2 + F \cdot F\right)}^{\frac{1}{2}}}{F}\right)}\right)\right) \]
      10. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \left(\frac{\color{blue}{{\left(2 + F \cdot F\right)}^{\frac{1}{2}}}}{F}\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{/.f64}\left(\left({\left(2 + F \cdot F\right)}^{\frac{1}{2}}\right), \color{blue}{F}\right)\right)\right) \]
      12. unpow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{/.f64}\left(\left(\sqrt{2 + F \cdot F}\right), F\right)\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(2 + F \cdot F\right)\right), F\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right), F\right)\right)\right) \]
      15. *-lowering-*.f6480.8%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right), F\right)\right)\right) \]
    7. Applied egg-rr80.8%

      \[\leadsto \color{blue}{\frac{1}{\sin B \cdot \frac{\sqrt{2 + F \cdot F}}{F}}} \]

    if -3e-103 < F < 2.35e-56

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.8%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6486.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified86.3%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6486.5%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr86.5%

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

    if 4.3e5 < F

    1. Initial program 61.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified76.2%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -310000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{-103}:\\ \;\;\;\;\frac{1}{\sin B \cdot \frac{\sqrt{F \cdot F + 2}}{F}}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{-56}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 430000:\\ \;\;\;\;\frac{1}{\sin B \cdot \frac{\sqrt{F \cdot F + 2}}{F}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.3% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -5.6 \cdot 10^{-99}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 6.6 \cdot 10^{-73}:\\
\;\;\;\;0 - t\_1\\

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

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


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

    1. Initial program 55.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified75.2%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    if -3.1e11 < F < -5.6000000000000001e-99 or 6.60000000000000007e-73 < F < 4.3e5

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(F, \color{blue}{\left(\frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\left(\sqrt{\frac{1}{2 + {F}^{2}}}\right), \color{blue}{\sin B}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \sin \color{blue}{B}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \sin B\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \sin B\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \sin B\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \sin B\right)\right) \]
      10. sin-lowering-sin.f6479.1%

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified79.1%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{\frac{1}{2 + F \cdot F}}}{\sin B}} \]

    if -5.6000000000000001e-99 < F < 6.60000000000000007e-73

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.8%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6487.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified87.0%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6487.2%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr87.2%

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

    if 4.3e5 < F

    1. Initial program 61.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified76.2%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -310000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5.6 \cdot 10^{-99}:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{F \cdot F + 2}}}{\sin B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-73}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 430000:\\ \;\;\;\;F \cdot \frac{\sqrt{\frac{1}{F \cdot F + 2}}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 86.2% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\frac{\sin B}{{\left(F \cdot F + 2\right)}^{-0.5}}}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -310000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\

\mathbf{elif}\;F \leq -4.9 \cdot 10^{-100}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.25 \cdot 10^{-69}:\\
\;\;\;\;0 - t\_1\\

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

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


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

    1. Initial program 55.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified75.2%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    if -3.1e11 < F < -4.9000000000000003e-100 or 1.25000000000000008e-69 < F < 4.3e5

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(F, \color{blue}{\left(\frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\left(\sqrt{\frac{1}{2 + {F}^{2}}}\right), \color{blue}{\sin B}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \sin \color{blue}{B}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \sin B\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \sin B\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \sin B\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \sin B\right)\right) \]
      10. sin-lowering-sin.f6479.1%

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified79.1%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{\frac{1}{2 + F \cdot F}}}{\sin B}} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto F \cdot \frac{1}{\color{blue}{\frac{\sin B}{\sqrt{\frac{1}{2 + F \cdot F}}}}} \]
      2. un-div-invN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(F, \mathsf{/.f64}\left(\sin B, \color{blue}{\left(\sqrt{\frac{1}{2 + F \cdot F}}\right)}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), \left(\sqrt{\color{blue}{\frac{1}{2 + F \cdot F}}}\right)\right)\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), \left({\left(\frac{1}{2 + F \cdot F}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right)\right) \]
      7. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), \left({\left({\left(2 + F \cdot F\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right)\right) \]
      8. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), \left({\left(2 + F \cdot F\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{pow.f64}\left(\left(2 + F \cdot F\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(2, \left(F \cdot F\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right)\right) \]
      12. metadata-eval79.0%

        \[\leadsto \mathsf{/.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right), \frac{-1}{2}\right)\right)\right) \]
    7. Applied egg-rr79.0%

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

    if -4.9000000000000003e-100 < F < 1.25000000000000008e-69

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.8%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6487.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified87.0%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6487.2%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr87.2%

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

    if 4.3e5 < F

    1. Initial program 61.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified76.2%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -310000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.9 \cdot 10^{-100}:\\ \;\;\;\;\frac{F}{\frac{\sin B}{{\left(F \cdot F + 2\right)}^{-0.5}}}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-69}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 430000:\\ \;\;\;\;\frac{F}{\frac{\sin B}{{\left(F \cdot F + 2\right)}^{-0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 92.2% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 18000:\\
\;\;\;\;\sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{B} - t\_0\\

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


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

    1. Initial program 55.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified75.2%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    if -3.1e11 < F < -8.4999999999999998e-106

    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 \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6492.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified92.9%

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{1}{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{1}{2}}}\right)\right)\right) \]
      5. pow1/2N/A

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{1}{\sqrt{\left(2 + F \cdot F\right) + 2 \cdot x}}\right)\right)\right) \]
      9. associate-+r+N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{1}{\sqrt{2 + \left(F \cdot F + 2 \cdot x\right)}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(1, \left(\sqrt{\left(F \cdot F + 2\right) + x \cdot 2}\right)\right)\right)\right) \]
      14. associate-+r+N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(1, \left(\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}\right)\right)\right)\right) \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\left(F \cdot F + \left(2 + x \cdot 2\right)\right)\right)\right)\right)\right) \]
      16. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 + x \cdot 2\right)\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + 2 \cdot x\right)\right)\right)\right)\right)\right) \]
      19. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{+.f64}\left(2, \left(2 \cdot x\right)\right)\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f6493.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(1, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right)\right) \]
    7. Applied egg-rr93.0%

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

    if -8.4999999999999998e-106 < F < 18000

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.7%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. /-lowering-/.f6494.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    10. Simplified94.0%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

    if 18000 < F

    1. Initial program 62.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified76.8%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.0%

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

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

Alternative 8: 92.2% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -4.6 \cdot 10^{-105}:\\
\;\;\;\;\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 20000:\\
\;\;\;\;\sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{B} - t\_0\\

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


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

    1. Initial program 55.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified75.2%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    if -1e12 < F < -4.6000000000000002e-105

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.5%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, 2\right)\right)\right), \frac{-1}{2}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6492.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, 2\right)\right)\right), \frac{-1}{2}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    7. Simplified92.9%

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

    if -4.6000000000000002e-105 < F < 2e4

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.7%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. /-lowering-/.f6494.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    10. Simplified94.0%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

    if 2e4 < F

    1. Initial program 62.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified76.8%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.0%

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

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

Alternative 9: 90.9% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 17000:\\
\;\;\;\;\sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{B} - t\_0\\

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


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

    1. Initial program 54.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified74.8%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

    if -3.8000000000000001e31 < F < 17000

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.7%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.7%

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. /-lowering-/.f6488.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    10. Simplified88.5%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

    if 17000 < F

    1. Initial program 62.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified76.8%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.0%

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

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

Alternative 10: 85.2% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -4.45 \cdot 10^{-100}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\

\mathbf{elif}\;F \leq 9.6 \cdot 10^{-54}:\\
\;\;\;\;0 - t\_0\\

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


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

    1. Initial program 57.1%

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

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified76.3%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified98.9%

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

    if -0.035000000000000003 < F < -4.4500000000000002e-100

    1. Initial program 99.1%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(F, \color{blue}{\left(\frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\left(\sqrt{\frac{1}{2 + {F}^{2}}}\right), \color{blue}{\sin B}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \sin \color{blue}{B}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \sin B\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \sin B\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \sin B\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \sin B\right)\right) \]
      10. sin-lowering-sin.f6473.5%

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified73.5%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{\frac{1}{2 + F \cdot F}}}{\sin B}} \]
    6. Taylor expanded in F around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2}}}{\sin B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2}}\right)\right), \sin \color{blue}{B}\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\frac{1}{2}\right)\right), \sin B\right) \]
      4. sin-lowering-sin.f6473.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified73.4%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]

    if -4.4500000000000002e-100 < F < 9.60000000000000053e-54

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.8%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6486.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified86.3%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6486.5%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr86.5%

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

    if 9.60000000000000053e-54 < F

    1. Initial program 65.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified78.7%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6493.1%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified93.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.035:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.45 \cdot 10^{-100}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{-54}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 78.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -3 \cdot 10^{-100}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\

\mathbf{elif}\;F \leq 1.46 \cdot 10^{-53}:\\
\;\;\;\;0 - t\_0\\

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


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

    1. Initial program 57.1%

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

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified76.3%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified98.9%

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

    if -0.0420000000000000026 < F < -3.0000000000000001e-100

    1. Initial program 99.1%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(F, \color{blue}{\left(\frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\left(\sqrt{\frac{1}{2 + {F}^{2}}}\right), \color{blue}{\sin B}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \sin \color{blue}{B}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \sin B\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \sin B\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \sin B\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \sin B\right)\right) \]
      10. sin-lowering-sin.f6473.5%

        \[\leadsto \mathsf{*.f64}\left(F, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified73.5%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{\frac{1}{2 + F \cdot F}}}{\sin B}} \]
    6. Taylor expanded in F around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2}}}{\sin B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2}}\right)\right), \sin \color{blue}{B}\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\frac{1}{2}\right)\right), \sin B\right) \]
      4. sin-lowering-sin.f6473.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified73.4%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]

    if -3.0000000000000001e-100 < F < 1.45999999999999989e-53

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.8%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6486.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified86.3%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6486.5%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr86.5%

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

    if 1.45999999999999989e-53 < F

    1. Initial program 65.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 \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6444.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified44.2%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    7. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      3. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      4. /-lowering-/.f6471.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified71.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.042:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{-100}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 1.46 \cdot 10^{-53}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 56.8% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.0038:\\ \;\;\;\;\frac{\left(\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \left(F + 0.16666666666666666 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) + B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333\right)\right)\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= B 0.0038)
   (/
    (-
     (+
      (*
       (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))
       (+ F (* 0.16666666666666666 (* F (* B B)))))
      (* B (* B (* x 0.3333333333333333))))
     x)
    B)
   (- 0.0 (/ x (tan B)))))
double code(double F, double B, double x) {
	double tmp;
	if (B <= 0.0038) {
		tmp = (((sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F + (0.16666666666666666 * (F * (B * B))))) + (B * (B * (x * 0.3333333333333333)))) - x) / B;
	} else {
		tmp = 0.0 - (x / tan(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 (b <= 0.0038d0) then
        tmp = (((sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0))))) * (f + (0.16666666666666666d0 * (f * (b * b))))) + (b * (b * (x * 0.3333333333333333d0)))) - x) / b
    else
        tmp = 0.0d0 - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (B <= 0.0038) {
		tmp = (((Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F + (0.16666666666666666 * (F * (B * B))))) + (B * (B * (x * 0.3333333333333333)))) - x) / B;
	} else {
		tmp = 0.0 - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if B <= 0.0038:
		tmp = (((math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F + (0.16666666666666666 * (F * (B * B))))) + (B * (B * (x * 0.3333333333333333)))) - x) / B
	else:
		tmp = 0.0 - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (B <= 0.0038)
		tmp = Float64(Float64(Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0))))) * Float64(F + Float64(0.16666666666666666 * Float64(F * Float64(B * B))))) + Float64(B * Float64(B * Float64(x * 0.3333333333333333)))) - x) / B);
	else
		tmp = Float64(0.0 - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (B <= 0.0038)
		tmp = (((sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F + (0.16666666666666666 * (F * (B * B))))) + (B * (B * (x * 0.3333333333333333)))) - x) / B;
	else
		tmp = 0.0 - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[B, 0.0038], N[(N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F + N[(0.16666666666666666 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(B * N[(B * N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(0.0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0038:\\
\;\;\;\;\frac{\left(\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \left(F + 0.16666666666666666 \cdot \left(F \cdot \left(B \cdot B\right)\right)\right) + B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333\right)\right)\right) - x}{B}\\

\mathbf{else}:\\
\;\;\;\;0 - \frac{x}{\tan B}\\


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

    1. Initial program 76.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x\right), \color{blue}{B}\right) \]
    5. Simplified62.2%

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

    if 0.00379999999999999999 < B

    1. Initial program 80.5%

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

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified80.6%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6480.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified80.6%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6460.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified60.2%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6460.3%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr60.3%

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

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

Alternative 13: 55.7% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{+153}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq -1.4 \cdot 10^{-45}:\\ \;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.55 \cdot 10^{+88}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3.2e+153)
   (/ -1.0 (/ (tan B) x))
   (if (<= F -1.4e-45)
     (/ (- (+ -1.0 (/ (+ 1.0 (* (* x 2.0) 0.5)) (* F F))) x) B)
     (if (<= F 2.55e+88) (- 0.0 (/ x (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.2e+153) {
		tmp = -1.0 / (tan(B) / x);
	} else if (F <= -1.4e-45) {
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B;
	} else if (F <= 2.55e+88) {
		tmp = 0.0 - (x / tan(B));
	} else {
		tmp = 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) :: tmp
    if (f <= (-3.2d+153)) then
        tmp = (-1.0d0) / (tan(b) / x)
    else if (f <= (-1.4d-45)) then
        tmp = (((-1.0d0) + ((1.0d0 + ((x * 2.0d0) * 0.5d0)) / (f * f))) - x) / b
    else if (f <= 2.55d+88) then
        tmp = 0.0d0 - (x / tan(b))
    else
        tmp = 1.0d0 / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.2e+153) {
		tmp = -1.0 / (Math.tan(B) / x);
	} else if (F <= -1.4e-45) {
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B;
	} else if (F <= 2.55e+88) {
		tmp = 0.0 - (x / Math.tan(B));
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3.2e+153:
		tmp = -1.0 / (math.tan(B) / x)
	elif F <= -1.4e-45:
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B
	elif F <= 2.55e+88:
		tmp = 0.0 - (x / math.tan(B))
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3.2e+153)
		tmp = Float64(-1.0 / Float64(tan(B) / x));
	elseif (F <= -1.4e-45)
		tmp = Float64(Float64(Float64(-1.0 + Float64(Float64(1.0 + Float64(Float64(x * 2.0) * 0.5)) / Float64(F * F))) - x) / B);
	elseif (F <= 2.55e+88)
		tmp = Float64(0.0 - Float64(x / tan(B)));
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3.2e+153)
		tmp = -1.0 / (tan(B) / x);
	elseif (F <= -1.4e-45)
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B;
	elseif (F <= 2.55e+88)
		tmp = 0.0 - (x / tan(B));
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3.2e+153], N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.4e-45], N[(N[(N[(-1.0 + N[(N[(1.0 + N[(N[(x * 2.0), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.55e+88], N[(0.0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{+153}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq -1.4 \cdot 10^{-45}:\\
\;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\

\mathbf{elif}\;F \leq 2.55 \cdot 10^{+88}:\\
\;\;\;\;0 - \frac{x}{\tan B}\\

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


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

    1. Initial program 42.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified60.4%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6460.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified60.4%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6460.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified60.4%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\frac{\tan B}{x}}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{-1}{\frac{\color{blue}{\tan B}}{x}} \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{\left(\frac{\tan B}{x}\right)}\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(\tan B, \color{blue}{x}\right)\right) \]
      9. tan-lowering-tan.f6460.5%

        \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(B\right), x\right)\right) \]
    12. Applied egg-rr60.5%

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

    if -3.2000000000000001e153 < F < -1.4000000000000001e-45

    1. Initial program 81.4%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6465.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified65.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right)}, x\right), B\right) \]
    7. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + \left(\mathsf{neg}\left(1\right)\right)\right), x\right), B\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + -1\right), x\right), B\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right), -1\right), x\right), B\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}}\right), -1\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot 2 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(1 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot 2\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(F \cdot F\right)\right), -1\right), x\right), B\right) \]
      13. *-lowering-*.f6461.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \mathsf{*.f64}\left(F, F\right)\right), -1\right), x\right), B\right) \]
    8. Simplified61.0%

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

    if -1.4000000000000001e-45 < F < 2.5499999999999999e88

    1. Initial program 98.7%

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

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.7%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.7%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6472.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified72.8%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6473.0%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr73.0%

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

    if 2.5499999999999999e88 < F

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.7%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right) \]
      2. sin-lowering-sin.f6456.0%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified56.0%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification66.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{+153}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq -1.4 \cdot 10^{-45}:\\ \;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.55 \cdot 10^{+88}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 55.8% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -1.4 \cdot 10^{-45}:\\
\;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\

\mathbf{elif}\;F \leq 3.4 \cdot 10^{+88}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.00000000000000002e151 or -1.4000000000000001e-45 < F < 3.40000000000000004e88

    1. Initial program 85.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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified90.7%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6490.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified90.7%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6470.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified70.0%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6470.1%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr70.1%

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

    if -1.00000000000000002e151 < F < -1.4000000000000001e-45

    1. Initial program 81.4%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6465.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified65.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right)}, x\right), B\right) \]
    7. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + \left(\mathsf{neg}\left(1\right)\right)\right), x\right), B\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + -1\right), x\right), B\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right), -1\right), x\right), B\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}}\right), -1\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot 2 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(1 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot 2\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(F \cdot F\right)\right), -1\right), x\right), B\right) \]
      13. *-lowering-*.f6461.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \mathsf{*.f64}\left(F, F\right)\right), -1\right), x\right), B\right) \]
    8. Simplified61.0%

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

    if 3.40000000000000004e88 < F

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.7%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right) \]
      2. sin-lowering-sin.f6456.0%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified56.0%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+151}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.4 \cdot 10^{-45}:\\ \;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{+88}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 57.0% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 1.15 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= B 1.15e-5)
   (/ (- (/ F (sqrt (+ (* F F) (+ 2.0 (* x 2.0))))) x) B)
   (- 0.0 (/ x (tan B)))))
double code(double F, double B, double x) {
	double tmp;
	if (B <= 1.15e-5) {
		tmp = ((F / sqrt(((F * F) + (2.0 + (x * 2.0))))) - x) / B;
	} else {
		tmp = 0.0 - (x / tan(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 (b <= 1.15d-5) then
        tmp = ((f / sqrt(((f * f) + (2.0d0 + (x * 2.0d0))))) - x) / b
    else
        tmp = 0.0d0 - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (B <= 1.15e-5) {
		tmp = ((F / Math.sqrt(((F * F) + (2.0 + (x * 2.0))))) - x) / B;
	} else {
		tmp = 0.0 - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if B <= 1.15e-5:
		tmp = ((F / math.sqrt(((F * F) + (2.0 + (x * 2.0))))) - x) / B
	else:
		tmp = 0.0 - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (B <= 1.15e-5)
		tmp = Float64(Float64(Float64(F / sqrt(Float64(Float64(F * F) + Float64(2.0 + Float64(x * 2.0))))) - x) / B);
	else
		tmp = Float64(0.0 - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (B <= 1.15e-5)
		tmp = ((F / sqrt(((F * F) + (2.0 + (x * 2.0))))) - x) / B;
	else
		tmp = 0.0 - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[B, 1.15e-5], N[(N[(N[(F / N[Sqrt[N[(N[(F * F), $MachinePrecision] + N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(0.0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.15 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - x}{B}\\

\mathbf{else}:\\
\;\;\;\;0 - \frac{x}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.15e-5

    1. Initial program 76.3%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6462.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified62.6%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \frac{\sqrt{1}}{\sqrt{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), x\right), B\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \frac{1}{\sqrt{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), x\right), B\right) \]
      3. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{F}{\sqrt{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), x\right), B\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \left(\sqrt{2 + \left(F \cdot F + 2 \cdot x\right)}\right)\right), x\right), B\right) \]
      5. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \left(\sqrt{\left(2 + F \cdot F\right) + 2 \cdot x}\right)\right), x\right), B\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)\right), x\right), B\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \left(\sqrt{\left(F \cdot F + 2\right) + x \cdot 2}\right)\right), x\right), B\right) \]
      8. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \left(\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}\right)\right), x\right), B\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\left(F \cdot F + \left(2 + x \cdot 2\right)\right)\right)\right), x\right), B\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 + x \cdot 2\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right)\right)\right), x\right), B\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + 2 \cdot x\right)\right)\right)\right), x\right), B\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{+.f64}\left(2, \left(2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      14. *-lowering-*.f6462.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), x\right), B\right) \]
    7. Applied egg-rr62.6%

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

    if 1.15e-5 < B

    1. Initial program 80.5%

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

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified80.6%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6480.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified80.6%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6460.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified60.2%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6460.3%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr60.3%

      \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.15 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 56.9% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 3.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= B 3.6e-6)
   (/ (- (* F (sqrt (/ 1.0 (+ (* F F) 2.0)))) x) B)
   (- 0.0 (/ x (tan B)))))
double code(double F, double B, double x) {
	double tmp;
	if (B <= 3.6e-6) {
		tmp = ((F * sqrt((1.0 / ((F * F) + 2.0)))) - x) / B;
	} else {
		tmp = 0.0 - (x / tan(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 (b <= 3.6d-6) then
        tmp = ((f * sqrt((1.0d0 / ((f * f) + 2.0d0)))) - x) / b
    else
        tmp = 0.0d0 - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (B <= 3.6e-6) {
		tmp = ((F * Math.sqrt((1.0 / ((F * F) + 2.0)))) - x) / B;
	} else {
		tmp = 0.0 - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if B <= 3.6e-6:
		tmp = ((F * math.sqrt((1.0 / ((F * F) + 2.0)))) - x) / B
	else:
		tmp = 0.0 - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (B <= 3.6e-6)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(Float64(F * F) + 2.0)))) - x) / B);
	else
		tmp = Float64(0.0 - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (B <= 3.6e-6)
		tmp = ((F * sqrt((1.0 / ((F * F) + 2.0)))) - x) / B;
	else
		tmp = 0.0 - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[B, 3.6e-6], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(0.0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}} - x}{B}\\

\mathbf{else}:\\
\;\;\;\;0 - \frac{x}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 3.59999999999999984e-6

    1. Initial program 76.3%

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

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified89.0%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6489.1%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified89.1%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), x\right), B\right) \]
      8. *-lowering-*.f6462.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), x\right), B\right) \]
    10. Simplified62.6%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + F \cdot F}} - x}{B}} \]

    if 3.59999999999999984e-6 < B

    1. Initial program 80.5%

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

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified80.6%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6480.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified80.6%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6460.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified60.2%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6460.3%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr60.3%

      \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 71.1% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-45}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.46 \cdot 10^{-53}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.4e-45)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 1.46e-53) (- 0.0 (/ x (tan B))) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.4e-45) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 1.46e-53) {
		tmp = 0.0 - (x / tan(B));
	} else {
		tmp = (1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.4d-45)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 1.46d-53) then
        tmp = 0.0d0 - (x / tan(b))
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.4e-45) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 1.46e-53) {
		tmp = 0.0 - (x / Math.tan(B));
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.4e-45:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 1.46e-53:
		tmp = 0.0 - (x / math.tan(B))
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.4e-45)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 1.46e-53)
		tmp = Float64(0.0 - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.4e-45)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 1.46e-53)
		tmp = 0.0 - (x / tan(B));
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.4e-45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.46e-53], N[(0.0 - N[(x / N[Tan[B], $MachinePrecision]), $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 -1.4 \cdot 10^{-45}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.46 \cdot 10^{-53}:\\
\;\;\;\;0 - \frac{x}{\tan B}\\

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


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

    1. Initial program 59.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 \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6436.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified36.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6470.1%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified70.1%

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

    if -1.4000000000000001e-45 < F < 1.45999999999999989e-53

    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. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.8%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.8%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6479.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified79.6%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6479.8%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr79.8%

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

    if 1.45999999999999989e-53 < F

    1. Initial program 65.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 \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6444.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified44.2%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    7. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      3. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      4. /-lowering-/.f6471.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified71.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-45}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.46 \cdot 10^{-53}:\\ \;\;\;\;0 - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 63.4% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4 \cdot 10^{-45}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 5.7 \cdot 10^{+88}:\\
\;\;\;\;0 - \frac{x}{\tan B}\\

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


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

    1. Initial program 59.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 \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6436.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified36.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6470.1%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified70.1%

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

    if -1.4000000000000001e-45 < F < 5.70000000000000021e88

    1. Initial program 98.7%

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

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

        \[\leadsto \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)} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\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)}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    3. Simplified99.7%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified99.7%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\sin B\right)\right) \]
      7. sin-lowering-sin.f6472.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{neg.f64}\left(\mathsf{sin.f64}\left(B\right)\right)\right) \]
    10. Simplified72.8%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg2N/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\frac{\sin B}{\cos B}}{x}}\right) \]
      4. tan-quotN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\tan B}{x}}\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{x}{\tan B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \tan B\right)\right) \]
      8. tan-lowering-tan.f6473.0%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    12. Applied egg-rr73.0%

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

    if 5.70000000000000021e88 < F

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.7%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right) \]
      2. sin-lowering-sin.f6456.0%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified56.0%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.8%

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

Alternative 19: 43.3% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-52}:\\ \;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-22}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.3e-52)
   (/ (- (+ -1.0 (/ (+ 1.0 (* (* x 2.0) 0.5)) (* F F))) x) B)
   (if (<= F 2.6e-22) (- 0.0 (/ x B)) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.3e-52) {
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B;
	} else if (F <= 2.6e-22) {
		tmp = 0.0 - (x / B);
	} else {
		tmp = 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) :: tmp
    if (f <= (-2.3d-52)) then
        tmp = (((-1.0d0) + ((1.0d0 + ((x * 2.0d0) * 0.5d0)) / (f * f))) - x) / b
    else if (f <= 2.6d-22) then
        tmp = 0.0d0 - (x / b)
    else
        tmp = 1.0d0 / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.3e-52) {
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B;
	} else if (F <= 2.6e-22) {
		tmp = 0.0 - (x / B);
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.3e-52:
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B
	elif F <= 2.6e-22:
		tmp = 0.0 - (x / B)
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.3e-52)
		tmp = Float64(Float64(Float64(-1.0 + Float64(Float64(1.0 + Float64(Float64(x * 2.0) * 0.5)) / Float64(F * F))) - x) / B);
	elseif (F <= 2.6e-22)
		tmp = Float64(0.0 - Float64(x / B));
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.3e-52)
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B;
	elseif (F <= 2.6e-22)
		tmp = 0.0 - (x / B);
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.3e-52], N[(N[(N[(-1.0 + N[(N[(1.0 + N[(N[(x * 2.0), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.6e-22], N[(0.0 - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{-52}:\\
\;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\

\mathbf{elif}\;F \leq 2.6 \cdot 10^{-22}:\\
\;\;\;\;0 - \frac{x}{B}\\

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


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

    1. Initial program 60.1%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6444.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified44.3%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right)}, x\right), B\right) \]
    7. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + \left(\mathsf{neg}\left(1\right)\right)\right), x\right), B\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + -1\right), x\right), B\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right), -1\right), x\right), B\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}}\right), -1\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot 2 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(1 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot 2\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(F \cdot F\right)\right), -1\right), x\right), B\right) \]
      13. *-lowering-*.f6452.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \mathsf{*.f64}\left(F, F\right)\right), -1\right), x\right), B\right) \]
    8. Simplified52.4%

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

    if -2.29999999999999994e-52 < F < 2.6e-22

    1. Initial program 99.4%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6456.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified56.7%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{x}{\color{blue}{\mathsf{neg}\left(B\right)}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(B\right)\right)}\right) \]
      4. neg-lowering-neg.f6444.5%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{neg.f64}\left(B\right)\right) \]
    8. Simplified44.5%

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

    if 2.6e-22 < F

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6495.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified95.1%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right) \]
      2. sin-lowering-sin.f6450.0%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified50.0%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-52}:\\ \;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-22}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 42.9% accurate, 12.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-52}:\\ \;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.45 \cdot 10^{-64}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{-1 + \left(x \cdot 2\right) \cdot -0.5}{F \cdot F}\right) - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.3e-52)
   (/ (- (+ -1.0 (/ (+ 1.0 (* (* x 2.0) 0.5)) (* F F))) x) B)
   (if (<= F 2.45e-64)
     (- 0.0 (/ x B))
     (/ (- (+ 1.0 (/ (+ -1.0 (* (* x 2.0) -0.5)) (* F F))) x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.3e-52) {
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B;
	} else if (F <= 2.45e-64) {
		tmp = 0.0 - (x / B);
	} else {
		tmp = ((1.0 + ((-1.0 + ((x * 2.0) * -0.5)) / (F * F))) - 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 <= (-2.3d-52)) then
        tmp = (((-1.0d0) + ((1.0d0 + ((x * 2.0d0) * 0.5d0)) / (f * f))) - x) / b
    else if (f <= 2.45d-64) then
        tmp = 0.0d0 - (x / b)
    else
        tmp = ((1.0d0 + (((-1.0d0) + ((x * 2.0d0) * (-0.5d0))) / (f * f))) - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.3e-52) {
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B;
	} else if (F <= 2.45e-64) {
		tmp = 0.0 - (x / B);
	} else {
		tmp = ((1.0 + ((-1.0 + ((x * 2.0) * -0.5)) / (F * F))) - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.3e-52:
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B
	elif F <= 2.45e-64:
		tmp = 0.0 - (x / B)
	else:
		tmp = ((1.0 + ((-1.0 + ((x * 2.0) * -0.5)) / (F * F))) - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.3e-52)
		tmp = Float64(Float64(Float64(-1.0 + Float64(Float64(1.0 + Float64(Float64(x * 2.0) * 0.5)) / Float64(F * F))) - x) / B);
	elseif (F <= 2.45e-64)
		tmp = Float64(0.0 - Float64(x / B));
	else
		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(x * 2.0) * -0.5)) / Float64(F * F))) - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.3e-52)
		tmp = ((-1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))) - x) / B;
	elseif (F <= 2.45e-64)
		tmp = 0.0 - (x / B);
	else
		tmp = ((1.0 + ((-1.0 + ((x * 2.0) * -0.5)) / (F * F))) - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.3e-52], N[(N[(N[(-1.0 + N[(N[(1.0 + N[(N[(x * 2.0), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.45e-64], N[(0.0 - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(-1.0 + N[(N[(x * 2.0), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{-52}:\\
\;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\

\mathbf{elif}\;F \leq 2.45 \cdot 10^{-64}:\\
\;\;\;\;0 - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \frac{-1 + \left(x \cdot 2\right) \cdot -0.5}{F \cdot F}\right) - x}{B}\\


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

    1. Initial program 60.1%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6444.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified44.3%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right)}, x\right), B\right) \]
    7. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + \left(\mathsf{neg}\left(1\right)\right)\right), x\right), B\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + -1\right), x\right), B\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right), -1\right), x\right), B\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}}\right), -1\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot 2 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(1 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot 2\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left({F}^{2}\right)\right), -1\right), x\right), B\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(F \cdot F\right)\right), -1\right), x\right), B\right) \]
      13. *-lowering-*.f6452.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \mathsf{*.f64}\left(F, F\right)\right), -1\right), x\right), B\right) \]
    8. Simplified52.4%

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

    if -2.29999999999999994e-52 < F < 2.4500000000000001e-64

    1. Initial program 99.4%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6457.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified57.9%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{x}{\color{blue}{\mathsf{neg}\left(B\right)}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(B\right)\right)}\right) \]
      4. neg-lowering-neg.f6445.2%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{neg.f64}\left(B\right)\right) \]
    8. Simplified45.2%

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

    if 2.4500000000000001e-64 < F

    1. Initial program 65.6%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6437.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified37.6%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)}, x\right), B\right) \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right), x\right), B\right) \]
      2. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{-1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}}\right)\right), x\right), B\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot \left(2 + 2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      4. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot 2 + \frac{-1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(-1 + \frac{-1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \left(\frac{-1}{2} \cdot \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(x \cdot 2\right)\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(F \cdot F\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6441.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \mathsf{*.f64}\left(F, F\right)\right)\right), x\right), B\right) \]
    8. Simplified41.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-52}:\\ \;\;\;\;\frac{\left(-1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.45 \cdot 10^{-64}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{-1 + \left(x \cdot 2\right) \cdot -0.5}{F \cdot F}\right) - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 43.3% accurate, 12.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{-88}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.45 \cdot 10^{-64}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{-1 + \left(x \cdot 2\right) \cdot -0.5}{F \cdot F}\right) - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.5e-88)
   (/ (- -1.0 x) B)
   (if (<= F 2.45e-64)
     (- 0.0 (/ x B))
     (/ (- (+ 1.0 (/ (+ -1.0 (* (* x 2.0) -0.5)) (* F F))) x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5e-88) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.45e-64) {
		tmp = 0.0 - (x / B);
	} else {
		tmp = ((1.0 + ((-1.0 + ((x * 2.0) * -0.5)) / (F * F))) - 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 <= (-5.5d-88)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 2.45d-64) then
        tmp = 0.0d0 - (x / b)
    else
        tmp = ((1.0d0 + (((-1.0d0) + ((x * 2.0d0) * (-0.5d0))) / (f * f))) - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5e-88) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.45e-64) {
		tmp = 0.0 - (x / B);
	} else {
		tmp = ((1.0 + ((-1.0 + ((x * 2.0) * -0.5)) / (F * F))) - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.5e-88:
		tmp = (-1.0 - x) / B
	elif F <= 2.45e-64:
		tmp = 0.0 - (x / B)
	else:
		tmp = ((1.0 + ((-1.0 + ((x * 2.0) * -0.5)) / (F * F))) - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.5e-88)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 2.45e-64)
		tmp = Float64(0.0 - Float64(x / B));
	else
		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(x * 2.0) * -0.5)) / Float64(F * F))) - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5.5e-88)
		tmp = (-1.0 - x) / B;
	elseif (F <= 2.45e-64)
		tmp = 0.0 - (x / B);
	else
		tmp = ((1.0 + ((-1.0 + ((x * 2.0) * -0.5)) / (F * F))) - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.5e-88], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.45e-64], N[(0.0 - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(-1.0 + N[(N[(x * 2.0), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{-88}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 2.45 \cdot 10^{-64}:\\
\;\;\;\;0 - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \frac{-1 + \left(x \cdot 2\right) \cdot -0.5}{F \cdot F}\right) - x}{B}\\


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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6446.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified46.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + x\right)\right)\right), \color{blue}{B}\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 - x\right), B\right) \]
      7. --lowering--.f6449.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
    8. Simplified49.6%

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

    if -5.49999999999999971e-88 < F < 2.4500000000000001e-64

    1. Initial program 99.5%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6457.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified57.4%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{x}{\color{blue}{\mathsf{neg}\left(B\right)}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(B\right)\right)}\right) \]
      4. neg-lowering-neg.f6446.6%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{neg.f64}\left(B\right)\right) \]
    8. Simplified46.6%

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

    if 2.4500000000000001e-64 < F

    1. Initial program 65.6%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6437.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified37.6%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)}, x\right), B\right) \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right), x\right), B\right) \]
      2. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{-1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}}\right)\right), x\right), B\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot \left(2 + 2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      4. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot 2 + \frac{-1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(-1 + \frac{-1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \left(\frac{-1}{2} \cdot \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(x \cdot 2\right)\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left({F}^{2}\right)\right)\right), x\right), B\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(F \cdot F\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6441.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \mathsf{*.f64}\left(F, F\right)\right)\right), x\right), B\right) \]
    8. Simplified41.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{-88}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.45 \cdot 10^{-64}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{-1 + \left(x \cdot 2\right) \cdot -0.5}{F \cdot F}\right) - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 43.8% accurate, 21.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{-87}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 3.2 \cdot 10^{-22}:\\
\;\;\;\;0 - \frac{x}{B}\\

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


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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6446.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified46.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + x\right)\right)\right), \color{blue}{B}\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 - x\right), B\right) \]
      7. --lowering--.f6449.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
    8. Simplified49.6%

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

    if -1.00000000000000002e-87 < F < 3.19999999999999987e-22

    1. Initial program 99.5%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6455.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified55.6%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{x}{\color{blue}{\mathsf{neg}\left(B\right)}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(B\right)\right)}\right) \]
      4. neg-lowering-neg.f6445.4%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{neg.f64}\left(B\right)\right) \]
    8. Simplified45.4%

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

    if 3.19999999999999987e-22 < F

    1. Initial program 63.5%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6438.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified38.5%

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

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(1 - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f6441.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, x\right), B\right) \]
    8. Simplified41.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-87}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-22}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 36.6% accurate, 32.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{-90}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -6e-90) (/ (- -1.0 x) B) (- 0.0 (/ x B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -6e-90) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = 0.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 <= (-6d-90)) then
        tmp = ((-1.0d0) - x) / b
    else
        tmp = 0.0d0 - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -6e-90) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = 0.0 - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -6e-90:
		tmp = (-1.0 - x) / B
	else:
		tmp = 0.0 - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -6e-90)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(0.0 - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -6e-90)
		tmp = (-1.0 - x) / B;
	else
		tmp = 0.0 - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -6e-90], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(0.0 - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-90}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;0 - \frac{x}{B}\\


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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6446.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified46.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + x\right)\right)\right), \color{blue}{B}\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 - x\right), B\right) \]
      7. --lowering--.f6449.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
    8. Simplified49.6%

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

    if -6.00000000000000041e-90 < F

    1. Initial program 83.5%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6448.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified48.1%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{x}{\color{blue}{\mathsf{neg}\left(B\right)}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(B\right)\right)}\right) \]
      4. neg-lowering-neg.f6436.8%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{neg.f64}\left(B\right)\right) \]
    8. Simplified36.8%

      \[\leadsto \color{blue}{\frac{x}{-B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.8%

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

Alternative 24: 17.1% accurate, 40.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.1 \cdot 10^{-79}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 3.0999999999999999e-79

    1. Initial program 82.8%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6452.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified52.5%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{2 + {F}^{2}}}\right), \color{blue}{\left(\frac{F}{B}\right)}\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \left(\frac{\color{blue}{F}}{B}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      8. /-lowering-/.f6414.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{/.f64}\left(F, \color{blue}{B}\right)\right) \]
    8. Simplified14.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{F}{B}} \]
    9. Taylor expanded in F around -inf

      \[\leadsto \color{blue}{\frac{-1}{B}} \]
    10. Step-by-step derivation
      1. /-lowering-/.f6414.5%

        \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{B}\right) \]
    11. Simplified14.5%

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

    if 3.0999999999999999e-79 < F

    1. Initial program 66.8%

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6490.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified90.1%

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right) \]
      2. sin-lowering-sin.f6446.3%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified46.3%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
    9. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{1}{B}} \]
    10. Step-by-step derivation
      1. /-lowering-/.f6417.7%

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{B}\right) \]
    11. Simplified17.7%

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

Alternative 25: 29.9% accurate, 64.8× speedup?

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

\\
0 - \frac{x}{B}
\end{array}
Derivation
  1. Initial program 77.4%

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
    7. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    11. *-lowering-*.f6447.5%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
  5. Simplified47.5%

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

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

      \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
    2. distribute-neg-frac2N/A

      \[\leadsto \frac{x}{\color{blue}{\mathsf{neg}\left(B\right)}} \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(B\right)\right)}\right) \]
    4. neg-lowering-neg.f6433.5%

      \[\leadsto \mathsf{/.f64}\left(x, \mathsf{neg.f64}\left(B\right)\right) \]
  8. Simplified33.5%

    \[\leadsto \color{blue}{\frac{x}{-B}} \]
  9. Final simplification33.5%

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

Alternative 26: 10.1% accurate, 108.0× 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 77.4%

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
    7. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    11. *-lowering-*.f6447.5%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
  5. Simplified47.5%

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{2 + {F}^{2}}}\right), \color{blue}{\left(\frac{F}{B}\right)}\right) \]
    3. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \left(\frac{\color{blue}{F}}{B}\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
    5. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
    6. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
    8. /-lowering-/.f6414.3%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{/.f64}\left(F, \color{blue}{B}\right)\right) \]
  8. Simplified14.3%

    \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{F}{B}} \]
  9. Taylor expanded in F around -inf

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  10. Step-by-step derivation
    1. /-lowering-/.f6410.6%

      \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{B}\right) \]
  11. Simplified10.6%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  12. Add Preprocessing

Alternative 27: 2.8% accurate, 108.0× speedup?

\[\begin{array}{l} \\ B \cdot 0.16666666666666666 \end{array} \]
(FPCore (F B x) :precision binary64 (* B 0.16666666666666666))
double code(double F, double B, double x) {
	return B * 0.16666666666666666;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = b * 0.16666666666666666d0
end function
public static double code(double F, double B, double x) {
	return B * 0.16666666666666666;
}
def code(F, B, x):
	return B * 0.16666666666666666
function code(F, B, x)
	return Float64(B * 0.16666666666666666)
end
function tmp = code(F, B, x)
	tmp = B * 0.16666666666666666;
end
code[F_, B_, x_] := N[(B * 0.16666666666666666), $MachinePrecision]
\begin{array}{l}

\\
B \cdot 0.16666666666666666
\end{array}
Derivation
  1. Initial program 77.4%

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
    2. sin-lowering-sin.f6457.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
  5. Simplified57.0%

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

    \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1 + \frac{1}{6} \cdot {B}^{2}}{B}\right)}\right) \]
  7. Step-by-step derivation
    1. /-lowering-/.f64N/A

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{1}{6}\right)\right), B\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{1}{6}\right)\right), B\right)\right) \]
    5. unpow2N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{1}{6}\right)\right), B\right)\right) \]
    6. *-lowering-*.f6435.7%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{1}{6}\right)\right), B\right)\right) \]
  8. Simplified35.7%

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

    \[\leadsto \color{blue}{\frac{1}{6} \cdot B} \]
  10. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto B \cdot \color{blue}{\frac{1}{6}} \]
    2. *-lowering-*.f642.9%

      \[\leadsto \mathsf{*.f64}\left(B, \color{blue}{\frac{1}{6}}\right) \]
  11. Simplified2.9%

    \[\leadsto \color{blue}{B \cdot 0.16666666666666666} \]
  12. Add Preprocessing

Reproduce

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