VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.8% → 99.5%
Time: 19.9s
Alternatives: 35
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 35 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.8% 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.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -9.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 0.0092:\\ \;\;\;\;\frac{{\left(F \cdot F + \left(x + 1\right) \cdot 2\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 -9.5e+32)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 0.0092)
       (- (/ (pow (+ (* F F) (* (+ x 1.0) 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 <= -9.5e+32) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 0.0092) {
		tmp = (pow(((F * F) + ((x + 1.0) * 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 <= (-9.5d+32)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 0.0092d0) then
        tmp = ((((f * f) + ((x + 1.0d0) * 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 <= -9.5e+32) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 0.0092) {
		tmp = (Math.pow(((F * F) + ((x + 1.0) * 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 <= -9.5e+32:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 0.0092:
		tmp = (math.pow(((F * F) + ((x + 1.0) * 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 <= -9.5e+32)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 0.0092)
		tmp = Float64(Float64((Float64(Float64(F * F) + Float64(Float64(x + 1.0) * 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 <= -9.5e+32)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 0.0092)
		tmp = ((((F * F) + ((x + 1.0) * 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, -9.5e+32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0092], N[(N[(N[Power[N[(N[(F * F), $MachinePrecision] + N[(N[(x + 1.0), $MachinePrecision] * 2.0), $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 -9.5 \cdot 10^{+32}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq 0.0092:\\
\;\;\;\;\frac{{\left(F \cdot F + \left(x + 1\right) \cdot 2\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 < -9.50000000000000006e32

    1. Initial program 60.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. Simplified78.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.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. Simplified99.9%

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

    if -9.50000000000000006e32 < F < 0.0091999999999999998

    1. Initial program 99.5%

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

    if 0.0091999999999999998 < F

    1. Initial program 58.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Simplified73.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 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.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5 \cdot 10^{+28}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 0.0092:\\ \;\;\;\;\frac{F \cdot {\left(F \cdot F + \left(2 - x \cdot -2\right)\right)}^{-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 -5e+28)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 0.0092)
       (- (/ (* F (pow (+ (* F F) (- 2.0 (* x -2.0))) -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 <= -5e+28) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 0.0092) {
		tmp = ((F * pow(((F * F) + (2.0 - (x * -2.0))), -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 <= (-5d+28)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 0.0092d0) then
        tmp = ((f * (((f * f) + (2.0d0 - (x * (-2.0d0)))) ** (-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 <= -5e+28) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 0.0092) {
		tmp = ((F * Math.pow(((F * F) + (2.0 - (x * -2.0))), -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 <= -5e+28:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 0.0092:
		tmp = ((F * math.pow(((F * F) + (2.0 - (x * -2.0))), -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 <= -5e+28)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 0.0092)
		tmp = Float64(Float64(Float64(F * (Float64(Float64(F * F) + Float64(2.0 - Float64(x * -2.0))) ^ -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 <= -5e+28)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 0.0092)
		tmp = ((F * (((F * F) + (2.0 - (x * -2.0))) ^ -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, -5e+28], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0092], 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] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 0.0092:\\
\;\;\;\;\frac{F \cdot {\left(F \cdot F + \left(2 - x \cdot -2\right)\right)}^{-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 < -4.99999999999999957e28

    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. Simplified79.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 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.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. Simplified99.9%

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

    if -4.99999999999999957e28 < F < 0.0091999999999999998

    1. Initial program 99.6%

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

    if 0.0091999999999999998 < F

    1. Initial program 58.0%

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

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

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

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


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

    1. Initial program 34.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. Simplified56.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 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.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. Simplified99.9%

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

    if -2.00000000000000007e154 < F < 3.9999999999999997e23

    1. Initial program 96.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. 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.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. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval99.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr99.5%

      \[\leadsto \frac{F \cdot \color{blue}{{\left({\left(F \cdot F + \left(x + 1\right) \cdot 2\right)}^{-0.25}\right)}^{2}}}{\sin B} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. pow-powN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Applied egg-rr99.6%

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

    if 3.9999999999999997e23 < F

    1. Initial program 54.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\frac{\color{blue}{x \cdot \cos B}}{\sin 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 \cdot \color{blue}{\cos B}}{\sin B}\right)\right) \]
      4. /-lowering-/.f64N/A

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

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

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

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    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. Simplified79.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 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.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. Simplified99.9%

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

    if -1.45e26 < F < 2.04999999999999998e23

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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.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. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval99.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr99.4%

      \[\leadsto \frac{F \cdot \color{blue}{{\left({\left(F \cdot F + \left(x + 1\right) \cdot 2\right)}^{-0.25}\right)}^{2}}}{\sin B} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. pow-powN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Applied egg-rr99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \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), \left(\frac{x}{\tan B}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \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), \left(\frac{x}{\tan B}\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \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), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      14. tan-lowering-tan.f6499.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \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), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    10. Applied egg-rr99.5%

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

    if 2.04999999999999998e23 < F

    1. Initial program 54.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\frac{\color{blue}{x \cdot \cos B}}{\sin 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 \cdot \color{blue}{\cos B}}{\sin B}\right)\right) \]
      4. /-lowering-/.f64N/A

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

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

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

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

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

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

Alternative 5: 99.7% accurate, 1.0× speedup?

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

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

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

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


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

    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. 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 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 -1e10 < F < 3.9999999999999997e23

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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.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-*.f6498.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(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. Simplified98.9%

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

    if 3.9999999999999997e23 < F

    1. Initial program 54.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\frac{\color{blue}{x \cdot \cos B}}{\sin 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 \cdot \color{blue}{\cos B}}{\sin B}\right)\right) \]
      4. /-lowering-/.f64N/A

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

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

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

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

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

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

Alternative 6: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -9.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 0.0092:\\ \;\;\;\;\frac{{\left(F \cdot F + 2\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 -9.5e+32)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 0.0092)
       (- (/ (pow (+ (* F F) 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 <= -9.5e+32) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 0.0092) {
		tmp = (pow(((F * F) + 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 <= (-9.5d+32)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 0.0092d0) then
        tmp = ((((f * f) + 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 <= -9.5e+32) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 0.0092) {
		tmp = (Math.pow(((F * F) + 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 <= -9.5e+32:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 0.0092:
		tmp = (math.pow(((F * F) + 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 <= -9.5e+32)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 0.0092)
		tmp = Float64(Float64((Float64(Float64(F * F) + 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 <= -9.5e+32)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 0.0092)
		tmp = ((((F * F) + 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, -9.5e+32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0092], N[(N[(N[Power[N[(N[(F * F), $MachinePrecision] + 2.0), $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 -9.5 \cdot 10^{+32}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq 0.0092:\\
\;\;\;\;\frac{{\left(F \cdot F + 2\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 < -9.50000000000000006e32

    1. Initial program 60.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. Simplified78.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.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. Simplified99.9%

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

    if -9.50000000000000006e32 < F < 0.0091999999999999998

    1. Initial program 99.5%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(2 + {F}^{2}\right)}, \frac{-1}{2}\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), F\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{pow.f64}\left(\mathsf{+.f64}\left(2, \left({F}^{2}\right)\right), \frac{-1}{2}\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(2, \left(F \cdot F\right)\right), \frac{-1}{2}\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. *-lowering-*.f6498.9%

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

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

    if 0.0091999999999999998 < F

    1. Initial program 58.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Simplified73.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 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.4%

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

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

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

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

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


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

    1. Initial program 34.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. Simplified56.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 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.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. Simplified99.9%

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

    if -2.00000000000000007e154 < F < 4.0000000000000001e27

    1. Initial program 96.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. 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.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. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval99.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr99.5%

      \[\leadsto \frac{F \cdot \color{blue}{{\left({\left(F \cdot F + \left(x + 1\right) \cdot 2\right)}^{-0.25}\right)}^{2}}}{\sin B} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. pow-powN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Applied egg-rr99.6%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\left(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) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left({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) \]
      3. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(F \cdot F\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-*.f6499.0%

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

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

    if 4.0000000000000001e27 < F

    1. Initial program 54.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\frac{\color{blue}{x \cdot \cos B}}{\sin 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 \cdot \color{blue}{\cos B}}{\sin B}\right)\right) \]
      4. /-lowering-/.f64N/A

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

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

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

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

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

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

Alternative 8: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.45:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 0.0092:\\ \;\;\;\;\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.45)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 0.0092)
       (- (/ (* 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.45) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 0.0092) {
		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.45d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 0.0092d0) 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.45) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 0.0092) {
		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.45:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 0.0092:
		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.45)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 0.0092)
		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.45)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 0.0092)
		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.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0092], 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.45:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq 0.0092:\\
\;\;\;\;\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.44999999999999996

    1. Initial program 64.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. 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. Simplified81.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.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. Simplified98.0%

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

    if -1.44999999999999996 < F < 0.0091999999999999998

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval99.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr99.4%

      \[\leadsto \frac{F \cdot \color{blue}{{\left({\left(F \cdot F + \left(x + 1\right) \cdot 2\right)}^{-0.25}\right)}^{2}}}{\sin B} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. pow-powN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Applied egg-rr99.5%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\left(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) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left({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) \]
      3. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(F \cdot F\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-*.f6499.1%

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

      \[\leadsto \frac{\frac{F}{\color{blue}{\sqrt{2 + F \cdot F}}}}{\sin B} - \frac{x}{\tan B} \]
    12. 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) \]
    13. 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.f6498.7%

        \[\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) \]
    14. Simplified98.7%

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

    if 0.0091999999999999998 < F

    1. Initial program 58.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Simplified73.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 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 9: 92.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4.4:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-89}:\\ \;\;\;\;\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \frac{F}{B} - t\_0\\ \mathbf{elif}\;F \leq 0.0032:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}^{\left(\frac{-1}{2}\right)} - \frac{x}{B}\\ \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 -4.4)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 1.3e-89)
       (- (* (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0))))) (/ F B)) t_0)
       (if (<= F 0.0032)
         (-
          (* (/ F (sin B)) (pow (+ (* x 2.0) (+ (* F F) 2.0)) (/ -1.0 2.0)))
          (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -4.4) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 1.3e-89) {
		tmp = (sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F / B)) - t_0;
	} else if (F <= 0.0032) {
		tmp = ((F / sin(B)) * pow(((x * 2.0) + ((F * F) + 2.0)), (-1.0 / 2.0))) - (x / B);
	} 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 <= (-4.4d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 1.3d-89) then
        tmp = (sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0))))) * (f / b)) - t_0
    else if (f <= 0.0032d0) then
        tmp = ((f / sin(b)) * (((x * 2.0d0) + ((f * f) + 2.0d0)) ** ((-1.0d0) / 2.0d0))) - (x / b)
    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 <= -4.4) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 1.3e-89) {
		tmp = (Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F / B)) - t_0;
	} else if (F <= 0.0032) {
		tmp = ((F / Math.sin(B)) * Math.pow(((x * 2.0) + ((F * F) + 2.0)), (-1.0 / 2.0))) - (x / B);
	} 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 <= -4.4:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 1.3e-89:
		tmp = (math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F / B)) - t_0
	elif F <= 0.0032:
		tmp = ((F / math.sin(B)) * math.pow(((x * 2.0) + ((F * F) + 2.0)), (-1.0 / 2.0))) - (x / B)
	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 <= -4.4)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 1.3e-89)
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0))))) * Float64(F / B)) - t_0);
	elseif (F <= 0.0032)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(x * 2.0) + Float64(Float64(F * F) + 2.0)) ^ Float64(-1.0 / 2.0))) - Float64(x / B));
	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 <= -4.4)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 1.3e-89)
		tmp = (sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F / B)) - t_0;
	elseif (F <= 0.0032)
		tmp = ((F / sin(B)) * (((x * 2.0) + ((F * F) + 2.0)) ^ (-1.0 / 2.0))) - (x / B);
	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, -4.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.3e-89], 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 / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0032], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(x * 2.0), $MachinePrecision] + N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 1.3 \cdot 10^{-89}:\\
\;\;\;\;\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \frac{F}{B} - t\_0\\

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

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


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

    1. Initial program 64.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. 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. Simplified81.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.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. Simplified98.0%

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

    if -4.4000000000000004 < F < 1.2999999999999999e-89

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. +-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(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-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(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. *-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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. /-lowering-/.f6485.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified85.6%

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

    if 1.2999999999999999e-89 < F < 0.00320000000000000015

    1. Initial program 99.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 \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-/.f6499.8%

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

      \[\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)} \]

    if 0.00320000000000000015 < F

    1. Initial program 58.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Simplified73.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 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 simplification94.3%

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

Alternative 10: 90.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{F}{\sqrt{F \cdot F + 2}}}{\sin B} - \frac{x}{B}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -22000000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t\_1\\ \mathbf{elif}\;F \leq -5.2 \cdot 10^{-149}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-94}:\\ \;\;\;\;0 - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.0092:\\ \;\;\;\;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 (+ (* F F) 2.0))) (sin B)) (/ x B)))
        (t_1 (/ x (tan B))))
   (if (<= F -22000000000000.0)
     (- (/ -1.0 (sin B)) t_1)
     (if (<= F -5.2e-149)
       t_0
       (if (<= F 1.9e-94)
         (- 0.0 (/ (* x (cos B)) (sin B)))
         (if (<= F 0.0092) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
	double t_0 = ((F / sqrt(((F * F) + 2.0))) / sin(B)) - (x / B);
	double t_1 = x / tan(B);
	double tmp;
	if (F <= -22000000000000.0) {
		tmp = (-1.0 / sin(B)) - t_1;
	} else if (F <= -5.2e-149) {
		tmp = t_0;
	} else if (F <= 1.9e-94) {
		tmp = 0.0 - ((x * cos(B)) / sin(B));
	} else if (F <= 0.0092) {
		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(((f * f) + 2.0d0))) / sin(b)) - (x / b)
    t_1 = x / tan(b)
    if (f <= (-22000000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_1
    else if (f <= (-5.2d-149)) then
        tmp = t_0
    else if (f <= 1.9d-94) then
        tmp = 0.0d0 - ((x * cos(b)) / sin(b))
    else if (f <= 0.0092d0) 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(((F * F) + 2.0))) / Math.sin(B)) - (x / B);
	double t_1 = x / Math.tan(B);
	double tmp;
	if (F <= -22000000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - t_1;
	} else if (F <= -5.2e-149) {
		tmp = t_0;
	} else if (F <= 1.9e-94) {
		tmp = 0.0 - ((x * Math.cos(B)) / Math.sin(B));
	} else if (F <= 0.0092) {
		tmp = t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = ((F / math.sqrt(((F * F) + 2.0))) / math.sin(B)) - (x / B)
	t_1 = x / math.tan(B)
	tmp = 0
	if F <= -22000000000000.0:
		tmp = (-1.0 / math.sin(B)) - t_1
	elif F <= -5.2e-149:
		tmp = t_0
	elif F <= 1.9e-94:
		tmp = 0.0 - ((x * math.cos(B)) / math.sin(B))
	elif F <= 0.0092:
		tmp = t_0
	else:
		tmp = (1.0 / math.sin(B)) - t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(Float64(F / sqrt(Float64(Float64(F * F) + 2.0))) / sin(B)) - Float64(x / B))
	t_1 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -22000000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_1);
	elseif (F <= -5.2e-149)
		tmp = t_0;
	elseif (F <= 1.9e-94)
		tmp = Float64(0.0 - Float64(Float64(x * cos(B)) / sin(B)));
	elseif (F <= 0.0092)
		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(((F * F) + 2.0))) / sin(B)) - (x / B);
	t_1 = x / tan(B);
	tmp = 0.0;
	if (F <= -22000000000000.0)
		tmp = (-1.0 / sin(B)) - t_1;
	elseif (F <= -5.2e-149)
		tmp = t_0;
	elseif (F <= 1.9e-94)
		tmp = 0.0 - ((x * cos(B)) / sin(B));
	elseif (F <= 0.0092)
		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[(N[(N[(F / N[Sqrt[N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -22000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -5.2e-149], t$95$0, If[LessEqual[F, 1.9e-94], N[(0.0 - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0092], 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{\frac{F}{\sqrt{F \cdot F + 2}}}{\sin B} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -22000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\

\mathbf{elif}\;F \leq -5.2 \cdot 10^{-149}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.9 \cdot 10^{-94}:\\
\;\;\;\;0 - \frac{x \cdot \cos B}{\sin B}\\

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

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


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

    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. 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.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.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.2e13 < F < -5.19999999999999998e-149 or 1.9e-94 < F < 0.0091999999999999998

    1. Initial program 99.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.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. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval99.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr99.2%

      \[\leadsto \frac{F \cdot \color{blue}{{\left({\left(F \cdot F + \left(x + 1\right) \cdot 2\right)}^{-0.25}\right)}^{2}}}{\sin B} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. pow-powN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Applied egg-rr99.4%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\left(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) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left({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) \]
      3. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(F \cdot F\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-*.f6497.7%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    14. Simplified86.0%

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

    if -5.19999999999999998e-149 < F < 1.9e-94

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval99.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr99.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    8. 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.f6484.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) \]
    9. Simplified84.6%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]

    if 0.0091999999999999998 < F

    1. Initial program 58.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Simplified73.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 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.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -22000000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5.2 \cdot 10^{-149}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + 2}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-94}:\\ \;\;\;\;0 - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.0092:\\ \;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + 2}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 92.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4.4:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{-75}:\\ \;\;\;\;\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \frac{F}{B} - t\_0\\ \mathbf{elif}\;F \leq 0.0085:\\ \;\;\;\;\frac{F \cdot {\left(F \cdot F + \left(2 - x \cdot -2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{B}\\ \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 -4.4)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 4.3e-75)
       (- (* (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0))))) (/ F B)) t_0)
       (if (<= F 0.0085)
         (-
          (/ (* F (pow (+ (* F F) (- 2.0 (* x -2.0))) -0.5)) (sin B))
          (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -4.4) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 4.3e-75) {
		tmp = (sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F / B)) - t_0;
	} else if (F <= 0.0085) {
		tmp = ((F * pow(((F * F) + (2.0 - (x * -2.0))), -0.5)) / sin(B)) - (x / B);
	} 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 <= (-4.4d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 4.3d-75) then
        tmp = (sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0))))) * (f / b)) - t_0
    else if (f <= 0.0085d0) then
        tmp = ((f * (((f * f) + (2.0d0 - (x * (-2.0d0)))) ** (-0.5d0))) / sin(b)) - (x / b)
    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 <= -4.4) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 4.3e-75) {
		tmp = (Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F / B)) - t_0;
	} else if (F <= 0.0085) {
		tmp = ((F * Math.pow(((F * F) + (2.0 - (x * -2.0))), -0.5)) / Math.sin(B)) - (x / B);
	} 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 <= -4.4:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 4.3e-75:
		tmp = (math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F / B)) - t_0
	elif F <= 0.0085:
		tmp = ((F * math.pow(((F * F) + (2.0 - (x * -2.0))), -0.5)) / math.sin(B)) - (x / B)
	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 <= -4.4)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 4.3e-75)
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0))))) * Float64(F / B)) - t_0);
	elseif (F <= 0.0085)
		tmp = Float64(Float64(Float64(F * (Float64(Float64(F * F) + Float64(2.0 - Float64(x * -2.0))) ^ -0.5)) / sin(B)) - Float64(x / B));
	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 <= -4.4)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 4.3e-75)
		tmp = (sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F / B)) - t_0;
	elseif (F <= 0.0085)
		tmp = ((F * (((F * F) + (2.0 - (x * -2.0))) ^ -0.5)) / sin(B)) - (x / B);
	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, -4.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 4.3e-75], 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 / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0085], 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], 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 -4.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq 4.3 \cdot 10^{-75}:\\
\;\;\;\;\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \frac{F}{B} - t\_0\\

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

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


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

    1. Initial program 64.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. 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. Simplified81.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.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. Simplified98.0%

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

    if -4.4000000000000004 < F < 4.2999999999999999e-75

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. +-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(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-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(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. *-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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. /-lowering-/.f6486.1%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified86.1%

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

    if 4.2999999999999999e-75 < F < 0.0085000000000000006

    1. Initial program 99.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. Simplified99.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 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-/.f6499.6%

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

      \[\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 0.0085000000000000006 < F

    1. Initial program 58.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Simplified73.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 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 simplification94.2%

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

Alternative 12: 92.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.28:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-77}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\ \mathbf{elif}\;F \leq 0.0092:\\ \;\;\;\;\frac{F \cdot {\left(F \cdot F + \left(2 - x \cdot -2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{B}\\ \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.28)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 6e-77)
       (- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
       (if (<= F 0.0092)
         (-
          (/ (* F (pow (+ (* F F) (- 2.0 (* x -2.0))) -0.5)) (sin B))
          (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -0.28) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 6e-77) {
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	} else if (F <= 0.0092) {
		tmp = ((F * pow(((F * F) + (2.0 - (x * -2.0))), -0.5)) / sin(B)) - (x / B);
	} 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.28d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 6d-77) then
        tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
    else if (f <= 0.0092d0) then
        tmp = ((f * (((f * f) + (2.0d0 - (x * (-2.0d0)))) ** (-0.5d0))) / sin(b)) - (x / b)
    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.28) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 6e-77) {
		tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	} else if (F <= 0.0092) {
		tmp = ((F * Math.pow(((F * F) + (2.0 - (x * -2.0))), -0.5)) / Math.sin(B)) - (x / B);
	} 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.28:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 6e-77:
		tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0
	elif F <= 0.0092:
		tmp = ((F * math.pow(((F * F) + (2.0 - (x * -2.0))), -0.5)) / math.sin(B)) - (x / B)
	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.28)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 6e-77)
		tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0);
	elseif (F <= 0.0092)
		tmp = Float64(Float64(Float64(F * (Float64(Float64(F * F) + Float64(2.0 - Float64(x * -2.0))) ^ -0.5)) / sin(B)) - Float64(x / B));
	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.28)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 6e-77)
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	elseif (F <= 0.0092)
		tmp = ((F * (((F * F) + (2.0 - (x * -2.0))) ^ -0.5)) / sin(B)) - (x / B);
	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.28], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6e-77], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0092], 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], 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.28:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

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

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

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


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

    1. Initial program 64.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. 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. Simplified81.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.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. Simplified98.0%

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

    if -0.28000000000000003 < F < 6.00000000000000033e-77

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. +-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(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-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(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. *-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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. /-lowering-/.f6486.1%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified86.1%

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

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

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

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

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

    if 6.00000000000000033e-77 < F < 0.0091999999999999998

    1. Initial program 99.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. Simplified99.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 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-/.f6499.6%

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

      \[\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 0.0091999999999999998 < F

    1. Initial program 58.0%

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

Alternative 13: 92.6% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 1.95 \cdot 10^{-70}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{t\_0}} - t\_1\\

\mathbf{elif}\;F \leq 0.0092:\\
\;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + t\_0}}}{\sin B} - \frac{x}{B}\\

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


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

    1. Initial program 64.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. 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. Simplified81.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.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. Simplified98.0%

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

    if -0.309999999999999998 < F < 1.9500000000000001e-70

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. +-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(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-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(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. *-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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. /-lowering-/.f6486.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified86.2%

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

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

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

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

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

    if 1.9500000000000001e-70 < F < 0.0091999999999999998

    1. Initial program 99.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. Simplified99.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. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval98.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr98.9%

      \[\leadsto \frac{F \cdot \color{blue}{{\left({\left(F \cdot F + \left(x + 1\right) \cdot 2\right)}^{-0.25}\right)}^{2}}}{\sin B} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. pow-powN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Applied egg-rr99.2%

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

      \[\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(x, 2\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    10. Step-by-step derivation
      1. /-lowering-/.f6499.2%

        \[\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(x, 2\right)\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    11. Simplified99.2%

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

    if 0.0091999999999999998 < F

    1. Initial program 58.0%

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

Alternative 14: 92.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.4:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-70}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\ \mathbf{elif}\;F \leq 0.0092:\\ \;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + 2}}}{\sin B} - \frac{x}{B}\\ \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.4)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 1.3e-70)
       (- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
       (if (<= F 0.0092)
         (- (/ (/ F (sqrt (+ (* F F) 2.0))) (sin B)) (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -0.4) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 1.3e-70) {
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	} else if (F <= 0.0092) {
		tmp = ((F / sqrt(((F * F) + 2.0))) / sin(B)) - (x / B);
	} 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.4d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 1.3d-70) then
        tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
    else if (f <= 0.0092d0) then
        tmp = ((f / sqrt(((f * f) + 2.0d0))) / sin(b)) - (x / b)
    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.4) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 1.3e-70) {
		tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	} else if (F <= 0.0092) {
		tmp = ((F / Math.sqrt(((F * F) + 2.0))) / Math.sin(B)) - (x / B);
	} 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.4:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 1.3e-70:
		tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0
	elif F <= 0.0092:
		tmp = ((F / math.sqrt(((F * F) + 2.0))) / math.sin(B)) - (x / B)
	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.4)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 1.3e-70)
		tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0);
	elseif (F <= 0.0092)
		tmp = Float64(Float64(Float64(F / sqrt(Float64(Float64(F * F) + 2.0))) / sin(B)) - Float64(x / B));
	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.4)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 1.3e-70)
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	elseif (F <= 0.0092)
		tmp = ((F / sqrt(((F * F) + 2.0))) / sin(B)) - (x / B);
	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.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.3e-70], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0092], N[(N[(N[(F / N[Sqrt[N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;F \leq 0.0092:\\
\;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + 2}}}{\sin B} - \frac{x}{B}\\

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


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

    1. Initial program 64.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. 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. Simplified81.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.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. Simplified98.0%

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

    if -0.40000000000000002 < F < 1.30000000000000001e-70

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. +-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(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-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(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. *-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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. /-lowering-/.f6486.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified86.2%

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

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

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

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

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

    if 1.30000000000000001e-70 < F < 0.0091999999999999998

    1. Initial program 99.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. Simplified99.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. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval98.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr98.9%

      \[\leadsto \frac{F \cdot \color{blue}{{\left({\left(F \cdot F + \left(x + 1\right) \cdot 2\right)}^{-0.25}\right)}^{2}}}{\sin B} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. pow-powN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Applied egg-rr99.2%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\left(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) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left({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) \]
      3. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(F \cdot F\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-*.f6495.8%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    14. Simplified95.8%

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

    if 0.0091999999999999998 < F

    1. Initial program 58.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Simplified73.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 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.8%

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

Alternative 15: 85.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5.5 \cdot 10^{-45}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-95}:\\ \;\;\;\;0 - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.0068:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{F \cdot F + 2}}\\ \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 -5.5e-45)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 2e-95)
       (- 0.0 (/ (* x (cos B)) (sin B)))
       (if (<= F 0.0068)
         (* (/ F (sin B)) (sqrt (/ 1.0 (+ (* F F) 2.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 <= -5.5e-45) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 2e-95) {
		tmp = 0.0 - ((x * cos(B)) / sin(B));
	} else if (F <= 0.0068) {
		tmp = (F / sin(B)) * sqrt((1.0 / ((F * F) + 2.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 <= (-5.5d-45)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 2d-95) then
        tmp = 0.0d0 - ((x * cos(b)) / sin(b))
    else if (f <= 0.0068d0) then
        tmp = (f / sin(b)) * sqrt((1.0d0 / ((f * f) + 2.0d0)))
    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 <= -5.5e-45) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 2e-95) {
		tmp = 0.0 - ((x * Math.cos(B)) / Math.sin(B));
	} else if (F <= 0.0068) {
		tmp = (F / Math.sin(B)) * Math.sqrt((1.0 / ((F * F) + 2.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 <= -5.5e-45:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 2e-95:
		tmp = 0.0 - ((x * math.cos(B)) / math.sin(B))
	elif F <= 0.0068:
		tmp = (F / math.sin(B)) * math.sqrt((1.0 / ((F * F) + 2.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 <= -5.5e-45)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 2e-95)
		tmp = Float64(0.0 - Float64(Float64(x * cos(B)) / sin(B)));
	elseif (F <= 0.0068)
		tmp = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(Float64(F * F) + 2.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 <= -5.5e-45)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 2e-95)
		tmp = 0.0 - ((x * cos(B)) / sin(B));
	elseif (F <= 0.0068)
		tmp = (F / sin(B)) * sqrt((1.0 / ((F * F) + 2.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, -5.5e-45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2e-95], N[(0.0 - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0068], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 2 \cdot 10^{-95}:\\
\;\;\;\;0 - \frac{x \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 0.0068:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{F \cdot F + 2}}\\

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


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

    1. Initial program 67.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. Simplified82.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.f6493.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. Simplified93.9%

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

    if -5.5000000000000003e-45 < F < 1.99999999999999998e-95

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval99.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr99.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    8. 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.f6477.7%

        \[\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) \]
    9. Simplified77.7%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]

    if 1.99999999999999998e-95 < F < 0.00679999999999999962

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

    if 0.00679999999999999962 < F

    1. Initial program 58.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Simplified73.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 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 simplification89.2%

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

Alternative 16: 85.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5.5 \cdot 10^{-45}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 9.8 \cdot 10^{-92}:\\ \;\;\;\;0 - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.0068:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\ \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 -5.5e-45)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 9.8e-92)
       (- 0.0 (/ (* x (cos B)) (sin B)))
       (if (<= F 0.0068)
         (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B)
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -5.5e-45) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 9.8e-92) {
		tmp = 0.0 - ((x * cos(B)) / sin(B));
	} else if (F <= 0.0068) {
		tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
	} 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 <= (-5.5d-45)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 9.8d-92) then
        tmp = 0.0d0 - ((x * cos(b)) / sin(b))
    else if (f <= 0.0068d0) then
        tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
    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 <= -5.5e-45) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 9.8e-92) {
		tmp = 0.0 - ((x * Math.cos(B)) / Math.sin(B));
	} else if (F <= 0.0068) {
		tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
	} 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 <= -5.5e-45:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 9.8e-92:
		tmp = 0.0 - ((x * math.cos(B)) / math.sin(B))
	elif F <= 0.0068:
		tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B
	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 <= -5.5e-45)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 9.8e-92)
		tmp = Float64(0.0 - Float64(Float64(x * cos(B)) / sin(B)));
	elseif (F <= 0.0068)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B);
	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 <= -5.5e-45)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 9.8e-92)
		tmp = 0.0 - ((x * cos(B)) / sin(B));
	elseif (F <= 0.0068)
		tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
	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, -5.5e-45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 9.8e-92], N[(0.0 - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0068], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 9.8 \cdot 10^{-92}:\\
\;\;\;\;0 - \frac{x \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 0.0068:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\

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


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

    1. Initial program 67.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. Simplified82.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.f6493.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. Simplified93.9%

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

    if -5.5000000000000003e-45 < F < 9.8e-92

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval99.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr99.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    8. 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.f6477.7%

        \[\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) \]
    9. Simplified77.7%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]

    if 9.8e-92 < F < 0.00679999999999999962

    1. Initial program 99.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-*.f6468.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. Simplified68.0%

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

    if 0.00679999999999999962 < F

    1. Initial program 58.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Simplified73.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 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 simplification88.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{-45}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 9.8 \cdot 10^{-92}:\\ \;\;\;\;0 - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.0068:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 78.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 6.8 \cdot 10^{-104}:\\
\;\;\;\;0 - \frac{x \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 0.0092:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\

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


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

    1. Initial program 67.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. Simplified82.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.f6493.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. Simplified93.9%

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

    if -5.3999999999999997e-45 < F < 6.80000000000000031e-104

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval99.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr99.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    8. 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.f6477.7%

        \[\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) \]
    9. Simplified77.7%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]

    if 6.80000000000000031e-104 < F < 0.0091999999999999998

    1. Initial program 99.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-*.f6468.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. Simplified68.0%

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

    if 0.0091999999999999998 < F

    1. Initial program 58.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. Simplified73.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 B around 0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. +-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(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-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(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. *-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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. /-lowering-/.f6449.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified49.5%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    10. Simplified78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.4 \cdot 10^{-45}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-104}:\\ \;\;\;\;0 - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.0092:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 57.3% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0305:\\
\;\;\;\;\frac{\left(\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \left(F \cdot \left(1 + 0.16666666666666666 \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 \cdot \cos B}{\sin B}\\


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

    1. Initial program 73.2%

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

      \[\leadsto \color{blue}{\frac{\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.6%

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

    if 0.030499999999999999 < B

    1. Initial program 90.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. Simplified90.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. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(F \cdot F + \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(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{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 - x \cdot -2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 - -2 \cdot x\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. distribute-rgt1-inN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      18. metadata-eval90.1%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(x, 1\right), 2\right)\right), \frac{-1}{4}\right), 2\right)\right), \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Applied egg-rr90.1%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    8. 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.f6452.5%

        \[\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) \]
    9. Simplified52.5%

      \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 0.0305:\\ \;\;\;\;\frac{\left(\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \left(F \cdot \left(1 + 0.16666666666666666 \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 \cdot \cos B}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 57.4% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1}{F}}{\frac{B \cdot \left(1 + B \cdot \left(B \cdot \left(\left(B \cdot B\right) \cdot 0.008333333333333333 + -0.16666666666666666\right)\right)\right)}{F}} - \frac{x}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.3000000000000001e-9

    1. Initial program 73.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-*.f6463.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. Simplified63.3%

      \[\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. /-lowering-/.f64N/A

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

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

    if 1.3000000000000001e-9 < B

    1. Initial program 89.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-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. 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}{\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-rr89.1%

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

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\color{blue}{\left(B \cdot \left(1 + {B}^{2} \cdot \left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right)\right)\right)}, F\right)\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(\mathsf{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \left(1 + {B}^{2} \cdot \left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right)\right)\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. +-lowering-+.f64N/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right) \cdot B\right), B\right)\right)\right), F\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{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right), B\right), B\right)\right)\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. sub-negN/A

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B\right), \frac{1}{120}\right), \frac{-1}{6}\right), B\right), B\right)\right)\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. *-lowering-*.f6452.3%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{1}{120}\right), \frac{-1}{6}\right), B\right), B\right)\right)\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    10. Simplified52.3%

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

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

Alternative 20: 57.3% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1}{F}}{\frac{B \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)}{F}} - \frac{x}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.3000000000000001e-9

    1. Initial program 73.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-*.f6463.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. Simplified63.3%

      \[\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. /-lowering-/.f64N/A

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

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

    if 1.3000000000000001e-9 < B

    1. Initial program 89.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-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. 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}{\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-rr89.1%

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

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\color{blue}{\left(B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)\right)}, F\right)\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(\mathsf{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{-1}{6}\right)\right)\right), F\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(-1, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{-1}{6}\right)\right)\right), F\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(-1, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{-1}{6}\right)\right)\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6451.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right)\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    10. Simplified51.9%

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

Alternative 21: 49.5% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
t_0 := \left(x \cdot 2\right) \cdot 0.5\\
\mathbf{if}\;B \leq 5.8 \cdot 10^{-179}:\\
\;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(-1 + \frac{-1 - t\_0}{F \cdot F}\right)} - x\right)\\

\mathbf{elif}\;B \leq 1.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + t\_0}{F \cdot F}\right)} - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 5.7999999999999998e-179

    1. Initial program 72.2%

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

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

      \[\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. clear-numN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \color{blue}{x}\right)\right) \]
    7. Applied egg-rr59.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \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)\right)\right)\right), x\right)\right) \]
      8. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

    if 5.7999999999999998e-179 < B < 1.2e-9

    1. Initial program 80.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-*.f6483.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. Simplified83.7%

      \[\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. clear-numN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \color{blue}{x}\right)\right) \]
    7. Applied egg-rr83.5%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(F, \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)\right)\right), x\right)\right) \]
      5. distribute-rgt-inN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 2\right), \frac{1}{2}\right)\right), \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), x\right)\right) \]
    10. Simplified83.9%

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

    if 1.2e-9 < B

    1. Initial program 89.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. Simplified89.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 B around 0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. +-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(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-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(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. *-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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. /-lowering-/.f6451.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified51.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 5.8 \cdot 10^{-179}:\\ \;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(-1 + \frac{-1 - \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\ \mathbf{elif}\;B \leq 1.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 56.9% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.3000000000000001e-9

    1. Initial program 73.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-*.f6463.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. Simplified63.3%

      \[\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. /-lowering-/.f64N/A

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

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

    if 1.3000000000000001e-9 < B

    1. Initial program 89.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. Simplified89.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 B around 0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. +-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(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-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(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. *-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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. /-lowering-/.f6451.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified51.6%

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

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

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

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

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

Alternative 23: 43.6% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.65 \cdot 10^{+71}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right)\right)\right) + \left(-1 - x\right)}{B}\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{-13}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{+87}:\\ \;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3.65e+71)
   (/
    (+
     (*
      (* B B)
      (+
       (* x 0.3333333333333333)
       (+
        -0.16666666666666666
        (*
         (* B B)
         (+
          (+
           (* x 0.022222222222222223)
           (*
            B
            (*
             B
             (+
              (* x -0.007407407407407408)
              (+ (* x 0.009523809523809525) -0.00205026455026455)))))
          -0.019444444444444445)))))
     (- -1.0 x))
    B)
   (if (<= F -2.5e-13)
     (/ -1.0 (sin B))
     (if (<= F 5.8e+87)
       (*
        (/ 1.0 B)
        (- (/ F (* F (+ 1.0 (/ (+ 1.0 (* (* x 2.0) 0.5)) (* F F))))) x))
       (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.65e+71) {
		tmp = (((B * B) * ((x * 0.3333333333333333) + (-0.16666666666666666 + ((B * B) * (((x * 0.022222222222222223) + (B * (B * ((x * -0.007407407407407408) + ((x * 0.009523809523809525) + -0.00205026455026455))))) + -0.019444444444444445))))) + (-1.0 - x)) / B;
	} else if (F <= -2.5e-13) {
		tmp = -1.0 / sin(B);
	} else if (F <= 5.8e+87) {
		tmp = (1.0 / B) * ((F / (F * (1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))))) - x);
	} 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.65d+71)) then
        tmp = (((b * b) * ((x * 0.3333333333333333d0) + ((-0.16666666666666666d0) + ((b * b) * (((x * 0.022222222222222223d0) + (b * (b * ((x * (-0.007407407407407408d0)) + ((x * 0.009523809523809525d0) + (-0.00205026455026455d0)))))) + (-0.019444444444444445d0)))))) + ((-1.0d0) - x)) / b
    else if (f <= (-2.5d-13)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= 5.8d+87) then
        tmp = (1.0d0 / b) * ((f / (f * (1.0d0 + ((1.0d0 + ((x * 2.0d0) * 0.5d0)) / (f * f))))) - x)
    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.65e+71) {
		tmp = (((B * B) * ((x * 0.3333333333333333) + (-0.16666666666666666 + ((B * B) * (((x * 0.022222222222222223) + (B * (B * ((x * -0.007407407407407408) + ((x * 0.009523809523809525) + -0.00205026455026455))))) + -0.019444444444444445))))) + (-1.0 - x)) / B;
	} else if (F <= -2.5e-13) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= 5.8e+87) {
		tmp = (1.0 / B) * ((F / (F * (1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))))) - x);
	} else {
		tmp = 1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3.65e+71:
		tmp = (((B * B) * ((x * 0.3333333333333333) + (-0.16666666666666666 + ((B * B) * (((x * 0.022222222222222223) + (B * (B * ((x * -0.007407407407407408) + ((x * 0.009523809523809525) + -0.00205026455026455))))) + -0.019444444444444445))))) + (-1.0 - x)) / B
	elif F <= -2.5e-13:
		tmp = -1.0 / math.sin(B)
	elif F <= 5.8e+87:
		tmp = (1.0 / B) * ((F / (F * (1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))))) - x)
	else:
		tmp = 1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3.65e+71)
		tmp = Float64(Float64(Float64(Float64(B * B) * Float64(Float64(x * 0.3333333333333333) + Float64(-0.16666666666666666 + Float64(Float64(B * B) * Float64(Float64(Float64(x * 0.022222222222222223) + Float64(B * Float64(B * Float64(Float64(x * -0.007407407407407408) + Float64(Float64(x * 0.009523809523809525) + -0.00205026455026455))))) + -0.019444444444444445))))) + Float64(-1.0 - x)) / B);
	elseif (F <= -2.5e-13)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 5.8e+87)
		tmp = Float64(Float64(1.0 / B) * Float64(Float64(F / Float64(F * Float64(1.0 + Float64(Float64(1.0 + Float64(Float64(x * 2.0) * 0.5)) / Float64(F * F))))) - x));
	else
		tmp = Float64(1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3.65e+71)
		tmp = (((B * B) * ((x * 0.3333333333333333) + (-0.16666666666666666 + ((B * B) * (((x * 0.022222222222222223) + (B * (B * ((x * -0.007407407407407408) + ((x * 0.009523809523809525) + -0.00205026455026455))))) + -0.019444444444444445))))) + (-1.0 - x)) / B;
	elseif (F <= -2.5e-13)
		tmp = -1.0 / sin(B);
	elseif (F <= 5.8e+87)
		tmp = (1.0 / B) * ((F / (F * (1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))))) - x);
	else
		tmp = 1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3.65e+71], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(x * 0.3333333333333333), $MachinePrecision] + N[(-0.16666666666666666 + N[(N[(B * B), $MachinePrecision] * N[(N[(N[(x * 0.022222222222222223), $MachinePrecision] + N[(B * N[(B * N[(N[(x * -0.007407407407407408), $MachinePrecision] + N[(N[(x * 0.009523809523809525), $MachinePrecision] + -0.00205026455026455), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.019444444444444445), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -2.5e-13], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.8e+87], N[(N[(1.0 / B), $MachinePrecision] * N[(N[(F / N[(F * N[(1.0 + N[(N[(1.0 + N[(N[(x * 2.0), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.65 \cdot 10^{+71}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right)\right)\right) + \left(-1 - x\right)}{B}\\

\mathbf{elif}\;F \leq -2.5 \cdot 10^{-13}:\\
\;\;\;\;\frac{-1}{\sin B}\\

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

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


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

    1. Initial program 56.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. 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}{\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-rr56.6%

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

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

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

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

      \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left(\left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right) - \frac{31}{15120}\right)\right)\right) - \frac{7}{360}\right)\right) - \frac{1}{6}\right) - \left(1 + x\right)}{B}} \]
    9. Simplified61.8%

      \[\leadsto \color{blue}{\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(\left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right) + -0.16666666666666666\right)\right) + \left(-1 - x\right)}{B}} \]

    if -3.64999999999999998e71 < F < -2.49999999999999995e-13

    1. Initial program 91.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-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. 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}{\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-rr91.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right) \]
    10. Simplified58.8%

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

    if -2.49999999999999995e-13 < F < 5.7999999999999996e87

    1. Initial program 98.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-*.f6457.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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified57.8%

      \[\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. clear-numN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \color{blue}{x}\right)\right) \]
    7. Applied egg-rr57.6%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(F, \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)\right)\right), x\right)\right) \]
      5. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

    if 5.7999999999999996e87 < F

    1. Initial program 45.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.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.f6457.9%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified57.9%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification52.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.65 \cdot 10^{+71}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right)\right)\right) + \left(-1 - x\right)}{B}\\ \mathbf{elif}\;F \leq -2.5 \cdot 10^{-13}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{+87}:\\ \;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 48.8% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
t_0 := \left(x \cdot 2\right) \cdot 0.5\\
\mathbf{if}\;B \leq 2.95 \cdot 10^{-179}:\\
\;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(-1 + \frac{-1 - t\_0}{F \cdot F}\right)} - x\right)\\

\mathbf{elif}\;B \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + t\_0}{F \cdot F}\right)} - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 2.95000000000000015e-179

    1. Initial program 72.2%

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

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

      \[\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. clear-numN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \color{blue}{x}\right)\right) \]
    7. Applied egg-rr59.3%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \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)\right)\right)\right), x\right)\right) \]
      8. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

    if 2.95000000000000015e-179 < B < 4.00000000000000033e-5

    1. Initial program 77.6%

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

      \[\leadsto \color{blue}{\frac{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-*.f6481.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. Simplified81.1%

      \[\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. clear-numN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \color{blue}{x}\right)\right) \]
    7. Applied egg-rr80.9%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(F, \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)\right)\right), x\right)\right) \]
      5. distribute-rgt-inN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 2\right), \frac{1}{2}\right)\right), \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), x\right)\right) \]
    10. Simplified81.3%

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

    if 4.00000000000000033e-5 < B

    1. Initial program 90.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. Simplified90.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 B around 0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. +-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(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-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(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. *-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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{F}{B}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. /-lowering-/.f6452.3%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\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), \mathsf{/.f64}\left(F, B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified52.3%

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    10. Simplified49.1%

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

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

Alternative 25: 44.1% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right)\right)\right) + \left(-1 - x\right)}{B}\\

\mathbf{elif}\;F \leq -1.2 \cdot 10^{-13}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\


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

    1. Initial program 56.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. 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}{\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-rr56.6%

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

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

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

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

      \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left(\left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right) - \frac{31}{15120}\right)\right)\right) - \frac{7}{360}\right)\right) - \frac{1}{6}\right) - \left(1 + x\right)}{B}} \]
    9. Simplified61.8%

      \[\leadsto \color{blue}{\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(\left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right) + -0.16666666666666666\right)\right) + \left(-1 - x\right)}{B}} \]

    if -8.5000000000000002e69 < F < -1.1999999999999999e-13

    1. Initial program 91.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-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. 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}{\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-rr91.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right) \]
    10. Simplified58.8%

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

    if -1.1999999999999999e-13 < F

    1. Initial program 83.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-*.f6449.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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified49.8%

      \[\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. clear-numN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \color{blue}{x}\right)\right) \]
    7. Applied egg-rr49.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(F, \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)\right)\right), x\right)\right) \]
      5. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right)\right)\right) + \left(-1 - x\right)}{B}\\ \mathbf{elif}\;F \leq -1.2 \cdot 10^{-13}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 43.9% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-54}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right)\right)\right) + \left(-1 - x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4e-54)
   (/
    (+
     (*
      (* B B)
      (+
       (* x 0.3333333333333333)
       (+
        -0.16666666666666666
        (*
         (* B B)
         (+
          (+
           (* x 0.022222222222222223)
           (*
            B
            (*
             B
             (+
              (* x -0.007407407407407408)
              (+ (* x 0.009523809523809525) -0.00205026455026455)))))
          -0.019444444444444445)))))
     (- -1.0 x))
    B)
   (*
    (/ 1.0 B)
    (- (/ F (* F (+ 1.0 (/ (+ 1.0 (* (* x 2.0) 0.5)) (* F F))))) x))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4e-54) {
		tmp = (((B * B) * ((x * 0.3333333333333333) + (-0.16666666666666666 + ((B * B) * (((x * 0.022222222222222223) + (B * (B * ((x * -0.007407407407407408) + ((x * 0.009523809523809525) + -0.00205026455026455))))) + -0.019444444444444445))))) + (-1.0 - x)) / B;
	} else {
		tmp = (1.0 / B) * ((F / (F * (1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))))) - x);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-4d-54)) then
        tmp = (((b * b) * ((x * 0.3333333333333333d0) + ((-0.16666666666666666d0) + ((b * b) * (((x * 0.022222222222222223d0) + (b * (b * ((x * (-0.007407407407407408d0)) + ((x * 0.009523809523809525d0) + (-0.00205026455026455d0)))))) + (-0.019444444444444445d0)))))) + ((-1.0d0) - x)) / b
    else
        tmp = (1.0d0 / b) * ((f / (f * (1.0d0 + ((1.0d0 + ((x * 2.0d0) * 0.5d0)) / (f * f))))) - x)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -4e-54) {
		tmp = (((B * B) * ((x * 0.3333333333333333) + (-0.16666666666666666 + ((B * B) * (((x * 0.022222222222222223) + (B * (B * ((x * -0.007407407407407408) + ((x * 0.009523809523809525) + -0.00205026455026455))))) + -0.019444444444444445))))) + (-1.0 - x)) / B;
	} else {
		tmp = (1.0 / B) * ((F / (F * (1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))))) - x);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4e-54:
		tmp = (((B * B) * ((x * 0.3333333333333333) + (-0.16666666666666666 + ((B * B) * (((x * 0.022222222222222223) + (B * (B * ((x * -0.007407407407407408) + ((x * 0.009523809523809525) + -0.00205026455026455))))) + -0.019444444444444445))))) + (-1.0 - x)) / B
	else:
		tmp = (1.0 / B) * ((F / (F * (1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))))) - x)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4e-54)
		tmp = Float64(Float64(Float64(Float64(B * B) * Float64(Float64(x * 0.3333333333333333) + Float64(-0.16666666666666666 + Float64(Float64(B * B) * Float64(Float64(Float64(x * 0.022222222222222223) + Float64(B * Float64(B * Float64(Float64(x * -0.007407407407407408) + Float64(Float64(x * 0.009523809523809525) + -0.00205026455026455))))) + -0.019444444444444445))))) + Float64(-1.0 - x)) / B);
	else
		tmp = Float64(Float64(1.0 / B) * Float64(Float64(F / Float64(F * Float64(1.0 + Float64(Float64(1.0 + Float64(Float64(x * 2.0) * 0.5)) / Float64(F * F))))) - x));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -4e-54)
		tmp = (((B * B) * ((x * 0.3333333333333333) + (-0.16666666666666666 + ((B * B) * (((x * 0.022222222222222223) + (B * (B * ((x * -0.007407407407407408) + ((x * 0.009523809523809525) + -0.00205026455026455))))) + -0.019444444444444445))))) + (-1.0 - x)) / B;
	else
		tmp = (1.0 / B) * ((F / (F * (1.0 + ((1.0 + ((x * 2.0) * 0.5)) / (F * F))))) - x);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4e-54], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(x * 0.3333333333333333), $MachinePrecision] + N[(-0.16666666666666666 + N[(N[(B * B), $MachinePrecision] * N[(N[(N[(x * 0.022222222222222223), $MachinePrecision] + N[(B * N[(B * N[(N[(x * -0.007407407407407408), $MachinePrecision] + N[(N[(x * 0.009523809523809525), $MachinePrecision] + -0.00205026455026455), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.019444444444444445), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] * N[(N[(F / N[(F * N[(1.0 + N[(N[(1.0 + N[(N[(x * 2.0), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{-54}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right)\right)\right) + \left(-1 - x\right)}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -4.0000000000000001e-54

    1. Initial program 67.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-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. 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}{\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-rr68.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left(\left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right) - \frac{31}{15120}\right)\right)\right) - \frac{7}{360}\right)\right) - \frac{1}{6}\right) - \left(1 + x\right)}{B}} \]
    9. Simplified52.9%

      \[\leadsto \color{blue}{\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(\left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right) + -0.16666666666666666\right)\right) + \left(-1 - x\right)}{B}} \]

    if -4.0000000000000001e-54 < F

    1. Initial program 82.9%

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

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

      \[\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. clear-numN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \color{blue}{x}\right)\right) \]
    7. Applied egg-rr49.3%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(F, \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)\right)\right), x\right)\right) \]
      5. distribute-rgt-inN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 2\right), \frac{1}{2}\right)\right), \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), x\right)\right) \]
    10. Simplified45.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-54}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(x \cdot 0.3333333333333333 + \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(\left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot -0.007407407407407408 + \left(x \cdot 0.009523809523809525 + -0.00205026455026455\right)\right)\right)\right) + -0.019444444444444445\right)\right)\right) + \left(-1 - x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 27: 44.0% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-57}:\\
\;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(x \cdot \left(B \cdot 0.3333333333333333\right)\right)}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -6.00000000000000001e-57

    1. Initial program 67.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-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. 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}{\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-rr68.0%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)\right), \color{blue}{B}\right) \]
      2. sub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(B \cdot B\right) \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(B \cdot \left(B \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \left(B \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      8. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \left(\frac{1}{3} \cdot x + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      9. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\left(\frac{1}{3} \cdot x\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\left(x \cdot \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      13. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right)\right), B\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right)\right), B\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(-1 - x\right)\right), B\right) \]
      16. --lowering--.f6452.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
    10. Simplified52.6%

      \[\leadsto \color{blue}{\frac{B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333 + -0.16666666666666666\right)\right) + \left(-1 - x\right)}{B}} \]
    11. Taylor expanded in x around inf

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(x, \left(B \cdot \frac{1}{3}\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
      7. *-lowering-*.f6452.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(B, \frac{1}{3}\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
    13. Simplified52.8%

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

    if -6.00000000000000001e-57 < F

    1. Initial program 82.9%

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

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

      \[\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. clear-numN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}}\right), \color{blue}{x}\right)\right) \]
    7. Applied egg-rr49.3%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(F, \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)\right)\right), x\right)\right) \]
      5. distribute-rgt-inN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, 2\right), \frac{1}{2}\right)\right), \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), x\right)\right) \]
    10. Simplified45.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{-57}:\\ \;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(x \cdot \left(B \cdot 0.3333333333333333\right)\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} \cdot \left(\frac{F}{F \cdot \left(1 + \frac{1 + \left(x \cdot 2\right) \cdot 0.5}{F \cdot F}\right)} - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 28: 44.0% accurate, 12.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.02 \cdot 10^{-55}:\\ \;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(x \cdot \left(B \cdot 0.3333333333333333\right)\right)}{B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \left(\left(B \cdot B\right) \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) - x\right)}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.02e-55)
   (/ (+ (- -1.0 x) (* B (* x (* B 0.3333333333333333)))) B)
   (if (<= F 6.2e-55)
     (/ x (- 0.0 B))
     (/
      (+
       1.0
       (- (* (* B B) (+ 0.16666666666666666 (* x 0.3333333333333333))) x))
      B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.02e-55) {
		tmp = ((-1.0 - x) + (B * (x * (B * 0.3333333333333333)))) / B;
	} else if (F <= 6.2e-55) {
		tmp = x / (0.0 - B);
	} else {
		tmp = (1.0 + (((B * B) * (0.16666666666666666 + (x * 0.3333333333333333))) - 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.02d-55)) then
        tmp = (((-1.0d0) - x) + (b * (x * (b * 0.3333333333333333d0)))) / b
    else if (f <= 6.2d-55) then
        tmp = x / (0.0d0 - b)
    else
        tmp = (1.0d0 + (((b * b) * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) - x)) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.02e-55) {
		tmp = ((-1.0 - x) + (B * (x * (B * 0.3333333333333333)))) / B;
	} else if (F <= 6.2e-55) {
		tmp = x / (0.0 - B);
	} else {
		tmp = (1.0 + (((B * B) * (0.16666666666666666 + (x * 0.3333333333333333))) - x)) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.02e-55:
		tmp = ((-1.0 - x) + (B * (x * (B * 0.3333333333333333)))) / B
	elif F <= 6.2e-55:
		tmp = x / (0.0 - B)
	else:
		tmp = (1.0 + (((B * B) * (0.16666666666666666 + (x * 0.3333333333333333))) - x)) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.02e-55)
		tmp = Float64(Float64(Float64(-1.0 - x) + Float64(B * Float64(x * Float64(B * 0.3333333333333333)))) / B);
	elseif (F <= 6.2e-55)
		tmp = Float64(x / Float64(0.0 - B));
	else
		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(B * B) * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) - x)) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.02e-55)
		tmp = ((-1.0 - x) + (B * (x * (B * 0.3333333333333333)))) / B;
	elseif (F <= 6.2e-55)
		tmp = x / (0.0 - B);
	else
		tmp = (1.0 + (((B * B) * (0.16666666666666666 + (x * 0.3333333333333333))) - x)) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.02e-55], N[(N[(N[(-1.0 - x), $MachinePrecision] + N[(B * N[(x * N[(B * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6.2e-55], N[(x / N[(0.0 - B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(N[(B * B), $MachinePrecision] * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.02 \cdot 10^{-55}:\\
\;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(x \cdot \left(B \cdot 0.3333333333333333\right)\right)}{B}\\

\mathbf{elif}\;F \leq 6.2 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{0 - B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(\left(B \cdot B\right) \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) - x\right)}{B}\\


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

    1. Initial program 67.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-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. 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}{\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-rr68.0%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)\right), \color{blue}{B}\right) \]
      2. sub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(B \cdot B\right) \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(B \cdot \left(B \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \left(B \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      8. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \left(\frac{1}{3} \cdot x + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      9. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\left(\frac{1}{3} \cdot x\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\left(x \cdot \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      13. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right)\right), B\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right)\right), B\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(-1 - x\right)\right), B\right) \]
      16. --lowering--.f6452.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
    10. Simplified52.6%

      \[\leadsto \color{blue}{\frac{B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333 + -0.16666666666666666\right)\right) + \left(-1 - x\right)}{B}} \]
    11. Taylor expanded in x around inf

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(x, \left(B \cdot \frac{1}{3}\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
      7. *-lowering-*.f6452.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(B, \frac{1}{3}\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
    13. Simplified52.8%

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

    if -1.02e-55 < F < 6.19999999999999993e-55

    1. Initial program 99.6%

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

      \[\leadsto \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.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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified56.8%

      \[\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 \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6445.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified45.2%

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

    if 6.19999999999999993e-55 < F

    1. Initial program 63.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{1}{3} \cdot x\right)\right)\right), x\right)\right), B\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(x \cdot \frac{1}{3}\right)\right)\right), x\right)\right), B\right) \]
      10. *-lowering-*.f6446.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(x, \frac{1}{3}\right)\right)\right), x\right)\right), B\right) \]
    8. Simplified46.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.02 \cdot 10^{-55}:\\ \;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(x \cdot \left(B \cdot 0.3333333333333333\right)\right)}{B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \left(\left(B \cdot B\right) \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) - x\right)}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 29: 43.9% accurate, 18.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.1 \cdot 10^{-56}:\\ \;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(x \cdot \left(B \cdot 0.3333333333333333\right)\right)}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.1e-56)
   (/ (+ (- -1.0 x) (* B (* x (* B 0.3333333333333333)))) B)
   (if (<= F 6e-55) (/ x (- 0.0 B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.1e-56) {
		tmp = ((-1.0 - x) + (B * (x * (B * 0.3333333333333333)))) / B;
	} else if (F <= 6e-55) {
		tmp = x / (0.0 - 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 <= (-1.1d-56)) then
        tmp = (((-1.0d0) - x) + (b * (x * (b * 0.3333333333333333d0)))) / b
    else if (f <= 6d-55) then
        tmp = x / (0.0d0 - 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 <= -1.1e-56) {
		tmp = ((-1.0 - x) + (B * (x * (B * 0.3333333333333333)))) / B;
	} else if (F <= 6e-55) {
		tmp = x / (0.0 - B);
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.1e-56:
		tmp = ((-1.0 - x) + (B * (x * (B * 0.3333333333333333)))) / B
	elif F <= 6e-55:
		tmp = x / (0.0 - B)
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.1e-56)
		tmp = Float64(Float64(Float64(-1.0 - x) + Float64(B * Float64(x * Float64(B * 0.3333333333333333)))) / B);
	elseif (F <= 6e-55)
		tmp = Float64(x / Float64(0.0 - 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 <= -1.1e-56)
		tmp = ((-1.0 - x) + (B * (x * (B * 0.3333333333333333)))) / B;
	elseif (F <= 6e-55)
		tmp = x / (0.0 - B);
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.1e-56], N[(N[(N[(-1.0 - x), $MachinePrecision] + N[(B * N[(x * N[(B * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6e-55], N[(x / N[(0.0 - B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.1 \cdot 10^{-56}:\\
\;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(x \cdot \left(B \cdot 0.3333333333333333\right)\right)}{B}\\

\mathbf{elif}\;F \leq 6 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{0 - B}\\

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


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

    1. Initial program 67.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-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. 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}{\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-rr68.0%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)\right), \color{blue}{B}\right) \]
      2. sub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(B \cdot B\right) \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(B \cdot \left(B \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \left(B \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      8. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \left(\frac{1}{3} \cdot x + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      9. metadata-evalN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\left(\frac{1}{3} \cdot x\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\left(x \cdot \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      13. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right)\right), B\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right)\right), B\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(-1 - x\right)\right), B\right) \]
      16. --lowering--.f6452.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
    10. Simplified52.6%

      \[\leadsto \color{blue}{\frac{B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333 + -0.16666666666666666\right)\right) + \left(-1 - x\right)}{B}} \]
    11. Taylor expanded in x around inf

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \left(x \cdot \left(\frac{1}{3} \cdot B\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(x, \left(\frac{1}{3} \cdot B\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(x, \left(B \cdot \frac{1}{3}\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
      7. *-lowering-*.f6452.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(B, \frac{1}{3}\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
    13. Simplified52.8%

      \[\leadsto \frac{B \cdot \color{blue}{\left(x \cdot \left(B \cdot 0.3333333333333333\right)\right)} + \left(-1 - x\right)}{B} \]

    if -1.10000000000000002e-56 < F < 6.00000000000000033e-55

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \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.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(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified56.8%

      \[\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 \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6445.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified45.2%

      \[\leadsto \frac{\color{blue}{0 - x}}{B} \]

    if 6.00000000000000033e-55 < F

    1. Initial program 63.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6440.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. Simplified40.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 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--.f6446.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, x\right), B\right) \]
    8. Simplified46.2%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.1 \cdot 10^{-56}:\\ \;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(x \cdot \left(B \cdot 0.3333333333333333\right)\right)}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 30: 43.9% accurate, 20.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{-45}:\\ \;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(B \cdot -0.16666666666666666\right)}{B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-56}:\\ \;\;\;\;\frac{x}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.5e-45)
   (/ (+ (- -1.0 x) (* B (* B -0.16666666666666666))) B)
   (if (<= F 7.2e-56) (/ x (- 0.0 B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5e-45) {
		tmp = ((-1.0 - x) + (B * (B * -0.16666666666666666))) / B;
	} else if (F <= 7.2e-56) {
		tmp = x / (0.0 - 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 <= (-5.5d-45)) then
        tmp = (((-1.0d0) - x) + (b * (b * (-0.16666666666666666d0)))) / b
    else if (f <= 7.2d-56) then
        tmp = x / (0.0d0 - 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 <= -5.5e-45) {
		tmp = ((-1.0 - x) + (B * (B * -0.16666666666666666))) / B;
	} else if (F <= 7.2e-56) {
		tmp = x / (0.0 - B);
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.5e-45:
		tmp = ((-1.0 - x) + (B * (B * -0.16666666666666666))) / B
	elif F <= 7.2e-56:
		tmp = x / (0.0 - B)
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.5e-45)
		tmp = Float64(Float64(Float64(-1.0 - x) + Float64(B * Float64(B * -0.16666666666666666))) / B);
	elseif (F <= 7.2e-56)
		tmp = Float64(x / Float64(0.0 - 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 <= -5.5e-45)
		tmp = ((-1.0 - x) + (B * (B * -0.16666666666666666))) / B;
	elseif (F <= 7.2e-56)
		tmp = x / (0.0 - B);
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.5e-45], N[(N[(N[(-1.0 - x), $MachinePrecision] + N[(B * N[(B * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.2e-56], N[(x / N[(0.0 - B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{-45}:\\
\;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(B \cdot -0.16666666666666666\right)}{B}\\

\mathbf{elif}\;F \leq 7.2 \cdot 10^{-56}:\\
\;\;\;\;\frac{x}{0 - B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.5000000000000003e-45

    1. Initial program 67.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-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. 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}{\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-rr67.6%

      \[\leadsto \color{blue}{\frac{{\left(F \cdot F + \left(x + 1\right) \cdot 2\right)}^{-0.5}}{\frac{\sin B}{F}} - \frac{x}{\tan B}} \]
    5. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{-1}{F}\right)}, \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6477.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(-1, F\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Simplified77.5%

      \[\leadsto \frac{\color{blue}{\frac{-1}{F}}}{\frac{\sin B}{F}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)}{B}} \]
    9. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)\right), \color{blue}{B}\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) + \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(B \cdot B\right) \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(B \cdot \left(B \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \left(B \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \left(\frac{1}{3} \cdot x - \frac{1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      8. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \left(\frac{1}{3} \cdot x + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \left(\frac{1}{3} \cdot x + \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\left(\frac{1}{3} \cdot x\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\left(x \cdot \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\mathsf{neg}\left(\left(1 + x\right)\right)\right)\right), B\right) \]
      13. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right)\right), B\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right)\right), B\right) \]
      15. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \left(-1 - x\right)\right), B\right) \]
      16. --lowering--.f6453.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{6}\right)\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
    10. Simplified53.1%

      \[\leadsto \color{blue}{\frac{B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333 + -0.16666666666666666\right)\right) + \left(-1 - x\right)}{B}} \]
    11. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \color{blue}{\left(\frac{-1}{6} \cdot B\right)}\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
    12. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \left(B \cdot \frac{-1}{6}\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
      2. *-lowering-*.f6453.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, \frac{-1}{6}\right)\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
    13. Simplified53.2%

      \[\leadsto \frac{B \cdot \color{blue}{\left(B \cdot -0.16666666666666666\right)} + \left(-1 - x\right)}{B} \]

    if -5.5000000000000003e-45 < F < 7.19999999999999956e-56

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \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.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. Simplified56.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 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6444.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified44.7%

      \[\leadsto \frac{\color{blue}{0 - x}}{B} \]

    if 7.19999999999999956e-56 < F

    1. Initial program 63.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6440.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. Simplified40.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 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--.f6446.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, x\right), B\right) \]
    8. Simplified46.2%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{-45}:\\ \;\;\;\;\frac{\left(-1 - x\right) + B \cdot \left(B \cdot -0.16666666666666666\right)}{B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-56}:\\ \;\;\;\;\frac{x}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 31: 43.9% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.3 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.05e-47)
   (/ (- -1.0 x) B)
   (if (<= F 6.3e-55) (/ x (- 0.0 B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.05e-47) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 6.3e-55) {
		tmp = x / (0.0 - 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 <= (-2.05d-47)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 6.3d-55) then
        tmp = x / (0.0d0 - 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 <= -2.05e-47) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 6.3e-55) {
		tmp = x / (0.0 - B);
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.05e-47:
		tmp = (-1.0 - x) / B
	elif F <= 6.3e-55:
		tmp = x / (0.0 - B)
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.05e-47)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 6.3e-55)
		tmp = Float64(x / Float64(0.0 - 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 <= -2.05e-47)
		tmp = (-1.0 - x) / B;
	elseif (F <= 6.3e-55)
		tmp = x / (0.0 - B);
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.05e-47], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6.3e-55], N[(x / N[(0.0 - B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.05 \cdot 10^{-47}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 6.3 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{0 - B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.05000000000000001e-47

    1. Initial program 67.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-*.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 \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--.f6452.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
    8. Simplified52.8%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -2.05000000000000001e-47 < F < 6.2999999999999997e-55

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \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.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. Simplified56.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 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6444.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified44.7%

      \[\leadsto \frac{\color{blue}{0 - x}}{B} \]

    if 6.2999999999999997e-55 < F

    1. Initial program 63.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6440.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. Simplified40.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 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--.f6446.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, x\right), B\right) \]
    8. Simplified46.2%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.3 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 32: 36.5% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.7 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.15 \cdot 10^{+122}:\\ \;\;\;\;\frac{x}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.7e-47)
   (/ (- -1.0 x) B)
   (if (<= F 3.15e+122) (/ x (- 0.0 B)) (/ 1.0 B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.7e-47) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.15e+122) {
		tmp = x / (0.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 <= (-1.7d-47)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 3.15d+122) then
        tmp = x / (0.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 <= -1.7e-47) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.15e+122) {
		tmp = x / (0.0 - B);
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.7e-47:
		tmp = (-1.0 - x) / B
	elif F <= 3.15e+122:
		tmp = x / (0.0 - B)
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.7e-47)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 3.15e+122)
		tmp = Float64(x / Float64(0.0 - B));
	else
		tmp = Float64(1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.7e-47)
		tmp = (-1.0 - x) / B;
	elseif (F <= 3.15e+122)
		tmp = x / (0.0 - B);
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.7e-47], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.15e+122], N[(x / N[(0.0 - B), $MachinePrecision]), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.7 \cdot 10^{-47}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 3.15 \cdot 10^{+122}:\\
\;\;\;\;\frac{x}{0 - B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.7000000000000001e-47

    1. Initial program 67.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-*.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 \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--.f6452.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
    8. Simplified52.8%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -1.7000000000000001e-47 < F < 3.1500000000000001e122

    1. Initial program 98.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \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.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. Simplified56.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 \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6440.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified40.9%

      \[\leadsto \frac{\color{blue}{0 - x}}{B} \]

    if 3.1500000000000001e122 < F

    1. Initial program 36.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.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.f6455.3%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified55.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-/.f6432.1%

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{B}\right) \]
    11. Simplified32.1%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.7 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.15 \cdot 10^{+122}:\\ \;\;\;\;\frac{x}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 33: 29.3% accurate, 32.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1.85 \cdot 10^{+122}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F 1.85e+122) (/ (- -1.0 x) B) (/ 1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 1.85e+122) {
		tmp = (-1.0 - x) / 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 <= 1.85d+122) then
        tmp = ((-1.0d0) - x) / 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 <= 1.85e+122) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 1.85e+122:
		tmp = (-1.0 - x) / B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 1.85e+122)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 1.85e+122)
		tmp = (-1.0 - x) / B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 1.85e+122], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.85 \cdot 10^{+122}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 1.8499999999999998e122

    1. Initial program 85.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-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-*.f6451.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. Simplified51.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 \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--.f6434.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
    8. Simplified34.9%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if 1.8499999999999998e122 < F

    1. Initial program 36.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.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.f6455.3%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified55.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-/.f6432.1%

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{B}\right) \]
    11. Simplified32.1%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 34: 17.0% accurate, 40.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 2.4 \cdot 10^{-126}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x) :precision binary64 (if (<= F 2.4e-126) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 2.4e-126) {
		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 <= 2.4d-126) 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 <= 2.4e-126) {
		tmp = -1.0 / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 2.4e-126:
		tmp = -1.0 / B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 2.4e-126)
		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 <= 2.4e-126)
		tmp = -1.0 / B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 2.4e-126], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.4 \cdot 10^{-126}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 2.40000000000000007e-126

    1. Initial program 83.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-*.f6449.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. Simplified49.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}{-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--.f6436.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
    8. Simplified36.7%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]
    9. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{-1}{B}} \]
    10. Step-by-step derivation
      1. /-lowering-/.f6415.3%

        \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{B}\right) \]
    11. Simplified15.3%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]

    if 2.40000000000000007e-126 < F

    1. Initial program 67.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf

      \[\leadsto \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.f6481.6%

        \[\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. Simplified81.6%

      \[\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.f6439.0%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right) \]
    8. Simplified39.0%

      \[\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-/.f6422.0%

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{B}\right) \]
    11. Simplified22.0%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 35: 10.6% 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.7%

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in B around 0

    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
  4. Step-by-step derivation
    1. /-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 -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--.f6432.3%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
  8. Simplified32.3%

    \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]
  9. Taylor expanded in x around 0

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  10. Step-by-step derivation
    1. /-lowering-/.f6411.0%

      \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{B}\right) \]
  11. Simplified11.0%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024288 
(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))))))