VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.9% → 99.5%
Time: 4.7s
Alternatives: 24
Speedup: 1.6×

Specification

?
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
(FPCore (F B x)
  :precision binary64
  (+
 (- (* x (/ 1 (tan B))))
 (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))
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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    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 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2), $MachinePrecision] + N[(2 * x), $MachinePrecision]), $MachinePrecision], (-N[(1 / 2), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}

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 24 alternatives:

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

Initial Program: 76.9% accurate, 1.0× speedup?

\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
(FPCore (F B x)
  :precision binary64
  (+
 (- (* x (/ 1 (tan B))))
 (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))
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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    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 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2), $MachinePrecision] + N[(2 * x), $MachinePrecision]), $MachinePrecision], (-N[(1 / 2), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}

Alternative 1: 99.5% accurate, 0.8× speedup?

\[\begin{array}{l} t_0 := \frac{-x}{\sin B} \cdot \cos B\\ \mathbf{if}\;F \leq -55000000000000002149535471559930195366881323454633330127876789695579674068438989725630022088130560:\\ \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + \cos B \cdot x}{F} \cdot F\right)\\ \mathbf{elif}\;F \leq 2:\\ \;\;\;\;t\_0 + \frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{1}{\sin B}\\ \end{array} \]
(FPCore (F B x)
  :precision binary64
  (let* ((t_0 (* (/ (- x) (sin B)) (cos B))))
  (if (<=
       F
       -55000000000000002149535471559930195366881323454633330127876789695579674068438989725630022088130560)
    (* (/ -1 (sin B)) (* (/ (+ 1 (* (cos B) x)) F) F))
    (if (<= F 2)
      (+ t_0 (* (/ (pow (- (+ x x) (- -2 (* F F))) -1/2) (sin B)) F))
      (+ t_0 (/ 1 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = (-x / sin(B)) * cos(B);
	double tmp;
	if (F <= -5.5e+97) {
		tmp = (-1.0 / sin(B)) * (((1.0 + (cos(B) * x)) / F) * F);
	} else if (F <= 2.0) {
		tmp = t_0 + ((pow(((x + x) - (-2.0 - (F * F))), -0.5) / sin(B)) * F);
	} else {
		tmp = t_0 + (1.0 / sin(B));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

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


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

    1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
      8. lower-/.f6451.4%

        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
    6. Applied rewrites51.4%

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
    7. Applied rewrites51.4%

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

    if -5.5000000000000002e97 < F < 2

    1. Initial program 76.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. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right) \cdot F} \]
    3. Applied rewrites85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2 < F

    1. Initial program 76.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. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right) \cdot F} \]
    3. Applied rewrites85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-x}{\sin B} \cdot \cos B + \frac{1}{\color{blue}{\sin B}} \]
      2. lower-sin.f6456.5%

        \[\leadsto \frac{-x}{\sin B} \cdot \cos B + \frac{1}{\sin B} \]
    8. Applied rewrites56.5%

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

Alternative 2: 99.5% accurate, 1.0× speedup?

\[\begin{array}{l} \mathbf{if}\;F \leq -152000000000000005562493165312671744:\\ \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + \cos B \cdot x}{F} \cdot F\right)\\ \mathbf{elif}\;F \leq 1750:\\ \;\;\;\;{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\sin B} \cdot \cos B + \frac{1}{\sin B}\\ \end{array} \]
(FPCore (F B x)
  :precision binary64
  (if (<= F -152000000000000005562493165312671744)
  (* (/ -1 (sin B)) (* (/ (+ 1 (* (cos B) x)) F) F))
  (if (<= F 1750)
    (-
     (* (pow (- (+ x x) (- -2 (* F F))) -1/2) (/ F (sin B)))
     (/ x (tan B)))
    (+ (* (/ (- x) (sin B)) (cos B)) (/ 1 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.52e+35) {
		tmp = (-1.0 / sin(B)) * (((1.0 + (cos(B) * x)) / F) * F);
	} else if (F <= 1750.0) {
		tmp = (pow(((x + x) - (-2.0 - (F * F))), -0.5) * (F / sin(B))) - (x / tan(B));
	} else {
		tmp = ((-x / sin(B)) * cos(B)) + (1.0 / sin(B));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.52d+35)) then
        tmp = ((-1.0d0) / sin(b)) * (((1.0d0 + (cos(b) * x)) / f) * f)
    else if (f <= 1750.0d0) then
        tmp = ((((x + x) - ((-2.0d0) - (f * f))) ** (-0.5d0)) * (f / sin(b))) - (x / tan(b))
    else
        tmp = ((-x / sin(b)) * cos(b)) + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.52e+35) {
		tmp = (-1.0 / Math.sin(B)) * (((1.0 + (Math.cos(B) * x)) / F) * F);
	} else if (F <= 1750.0) {
		tmp = (Math.pow(((x + x) - (-2.0 - (F * F))), -0.5) * (F / Math.sin(B))) - (x / Math.tan(B));
	} else {
		tmp = ((-x / Math.sin(B)) * Math.cos(B)) + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.52e+35:
		tmp = (-1.0 / math.sin(B)) * (((1.0 + (math.cos(B) * x)) / F) * F)
	elif F <= 1750.0:
		tmp = (math.pow(((x + x) - (-2.0 - (F * F))), -0.5) * (F / math.sin(B))) - (x / math.tan(B))
	else:
		tmp = ((-x / math.sin(B)) * math.cos(B)) + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.52e+35)
		tmp = Float64(Float64(-1.0 / sin(B)) * Float64(Float64(Float64(1.0 + Float64(cos(B) * x)) / F) * F));
	elseif (F <= 1750.0)
		tmp = Float64(Float64((Float64(Float64(x + x) - Float64(-2.0 - Float64(F * F))) ^ -0.5) * Float64(F / sin(B))) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(Float64(Float64(-x) / sin(B)) * cos(B)) + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.52e+35)
		tmp = (-1.0 / sin(B)) * (((1.0 + (cos(B) * x)) / F) * F);
	elseif (F <= 1750.0)
		tmp = ((((x + x) - (-2.0 - (F * F))) ^ -0.5) * (F / sin(B))) - (x / tan(B));
	else
		tmp = ((-x / sin(B)) * cos(B)) + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -152000000000000005562493165312671744], N[(N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1750], N[(N[(N[Power[N[(N[(x + x), $MachinePrecision] - N[(-2 - N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -152000000000000005562493165312671744:\\
\;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + \cos B \cdot x}{F} \cdot F\right)\\

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

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


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

    1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
      8. lower-/.f6451.4%

        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
    6. Applied rewrites51.4%

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
    7. Applied rewrites51.4%

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

    if -1.5200000000000001e35 < F < 1750

    1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Applied rewrites77.0%

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

    if 1750 < F

    1. Initial program 76.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. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right) \cdot F} \]
    3. Applied rewrites85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-x}{\sin B} \cdot \cos B + \frac{1}{\color{blue}{\sin B}} \]
      2. lower-sin.f6456.5%

        \[\leadsto \frac{-x}{\sin B} \cdot \cos B + \frac{1}{\sin B} \]
    8. Applied rewrites56.5%

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

Alternative 3: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \mathbf{if}\;F \leq -100000000000000004764729344:\\ \;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 2:\\ \;\;\;\;\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F - \cos B \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\sin B} \cdot \cos B + \frac{1}{\sin B}\\ \end{array} \]
(FPCore (F B x)
  :precision binary64
  (if (<= F -100000000000000004764729344)
  (/ (+ 1 (* x (cos B))) (- (sin B)))
  (if (<= F 2)
    (/
     (- (* (pow (- (+ x x) (- -2 (* F F))) -1/2) F) (* (cos B) x))
     (sin B))
    (+ (* (/ (- x) (sin B)) (cos B)) (/ 1 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1e+26) {
		tmp = (1.0 + (x * cos(B))) / -sin(B);
	} else if (F <= 2.0) {
		tmp = ((pow(((x + x) - (-2.0 - (F * F))), -0.5) * F) - (cos(B) * x)) / sin(B);
	} else {
		tmp = ((-x / sin(B)) * cos(B)) + (1.0 / sin(B));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1d+26)) then
        tmp = (1.0d0 + (x * cos(b))) / -sin(b)
    else if (f <= 2.0d0) then
        tmp = (((((x + x) - ((-2.0d0) - (f * f))) ** (-0.5d0)) * f) - (cos(b) * x)) / sin(b)
    else
        tmp = ((-x / sin(b)) * cos(b)) + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1e+26) {
		tmp = (1.0 + (x * Math.cos(B))) / -Math.sin(B);
	} else if (F <= 2.0) {
		tmp = ((Math.pow(((x + x) - (-2.0 - (F * F))), -0.5) * F) - (Math.cos(B) * x)) / Math.sin(B);
	} else {
		tmp = ((-x / Math.sin(B)) * Math.cos(B)) + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1e+26:
		tmp = (1.0 + (x * math.cos(B))) / -math.sin(B)
	elif F <= 2.0:
		tmp = ((math.pow(((x + x) - (-2.0 - (F * F))), -0.5) * F) - (math.cos(B) * x)) / math.sin(B)
	else:
		tmp = ((-x / math.sin(B)) * math.cos(B)) + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1e+26)
		tmp = Float64(Float64(1.0 + Float64(x * cos(B))) / Float64(-sin(B)));
	elseif (F <= 2.0)
		tmp = Float64(Float64(Float64((Float64(Float64(x + x) - Float64(-2.0 - Float64(F * F))) ^ -0.5) * F) - Float64(cos(B) * x)) / sin(B));
	else
		tmp = Float64(Float64(Float64(Float64(-x) / sin(B)) * cos(B)) + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1e+26)
		tmp = (1.0 + (x * cos(B))) / -sin(B);
	elseif (F <= 2.0)
		tmp = (((((x + x) - (-2.0 - (F * F))) ^ -0.5) * F) - (cos(B) * x)) / sin(B);
	else
		tmp = ((-x / sin(B)) * cos(B)) + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -100000000000000004764729344], N[(N[(1 + N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 2], N[(N[(N[(N[Power[N[(N[(x + x), $MachinePrecision] - N[(-2 - N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision] * F), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -100000000000000004764729344:\\
\;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\

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

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


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

    1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
      8. lower-/.f6451.4%

        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
    6. Applied rewrites51.4%

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

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

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

        \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
      3. lower-cos.f6455.8%

        \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
    9. Applied rewrites55.8%

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

    if -1e26 < F < 2

    1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

    if 2 < F

    1. Initial program 76.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. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right) \cdot F} \]
    3. Applied rewrites85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-x}{\sin B} \cdot \cos B + \frac{1}{\color{blue}{\sin B}} \]
      2. lower-sin.f6456.5%

        \[\leadsto \frac{-x}{\sin B} \cdot \cos B + \frac{1}{\sin B} \]
    8. Applied rewrites56.5%

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

Alternative 4: 98.8% accurate, 1.1× speedup?

\[\begin{array}{l} \mathbf{if}\;F \leq \frac{-2050338190066411}{19342813113834066795298816}:\\ \;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 2:\\ \;\;\;\;\frac{{\left(\left(x + x\right) - -2\right)}^{\frac{-1}{2}} \cdot F - \cos B \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\sin B} \cdot \cos B + \frac{1}{\sin B}\\ \end{array} \]
(FPCore (F B x)
  :precision binary64
  (if (<= F -2050338190066411/19342813113834066795298816)
  (/ (+ 1 (* x (cos B))) (- (sin B)))
  (if (<= F 2)
    (/ (- (* (pow (- (+ x x) -2) -1/2) F) (* (cos B) x)) (sin B))
    (+ (* (/ (- x) (sin B)) (cos B)) (/ 1 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.06e-10) {
		tmp = (1.0 + (x * cos(B))) / -sin(B);
	} else if (F <= 2.0) {
		tmp = ((pow(((x + x) - -2.0), -0.5) * F) - (cos(B) * x)) / sin(B);
	} else {
		tmp = ((-x / sin(B)) * cos(B)) + (1.0 / sin(B));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.06d-10)) then
        tmp = (1.0d0 + (x * cos(b))) / -sin(b)
    else if (f <= 2.0d0) then
        tmp = (((((x + x) - (-2.0d0)) ** (-0.5d0)) * f) - (cos(b) * x)) / sin(b)
    else
        tmp = ((-x / sin(b)) * cos(b)) + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.06e-10) {
		tmp = (1.0 + (x * Math.cos(B))) / -Math.sin(B);
	} else if (F <= 2.0) {
		tmp = ((Math.pow(((x + x) - -2.0), -0.5) * F) - (Math.cos(B) * x)) / Math.sin(B);
	} else {
		tmp = ((-x / Math.sin(B)) * Math.cos(B)) + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.06e-10:
		tmp = (1.0 + (x * math.cos(B))) / -math.sin(B)
	elif F <= 2.0:
		tmp = ((math.pow(((x + x) - -2.0), -0.5) * F) - (math.cos(B) * x)) / math.sin(B)
	else:
		tmp = ((-x / math.sin(B)) * math.cos(B)) + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.06e-10)
		tmp = Float64(Float64(1.0 + Float64(x * cos(B))) / Float64(-sin(B)));
	elseif (F <= 2.0)
		tmp = Float64(Float64(Float64((Float64(Float64(x + x) - -2.0) ^ -0.5) * F) - Float64(cos(B) * x)) / sin(B));
	else
		tmp = Float64(Float64(Float64(Float64(-x) / sin(B)) * cos(B)) + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.06e-10)
		tmp = (1.0 + (x * cos(B))) / -sin(B);
	elseif (F <= 2.0)
		tmp = (((((x + x) - -2.0) ^ -0.5) * F) - (cos(B) * x)) / sin(B);
	else
		tmp = ((-x / sin(B)) * cos(B)) + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2050338190066411/19342813113834066795298816], N[(N[(1 + N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 2], N[(N[(N[(N[Power[N[(N[(x + x), $MachinePrecision] - -2), $MachinePrecision], -1/2], $MachinePrecision] * F), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq \frac{-2050338190066411}{19342813113834066795298816}:\\
\;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\

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

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


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

    1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
      8. lower-/.f6451.4%

        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
    6. Applied rewrites51.4%

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

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

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

        \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
      3. lower-cos.f6455.8%

        \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
    9. Applied rewrites55.8%

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

    if -1.06e-10 < F < 2

    1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      if 2 < F

      1. Initial program 76.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. lift-*.f64N/A

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right) \cdot F} \]
      3. Applied rewrites85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{-x}{\sin B} \cdot \cos B + \frac{1}{\color{blue}{\sin B}} \]
        2. lower-sin.f6456.5%

          \[\leadsto \frac{-x}{\sin B} \cdot \cos B + \frac{1}{\sin B} \]
      8. Applied rewrites56.5%

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

    Alternative 5: 98.8% accurate, 1.1× speedup?

    \[\begin{array}{l} t_0 := \cos B \cdot x\\ \mathbf{if}\;F \leq \frac{-2050338190066411}{19342813113834066795298816}:\\ \;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 2:\\ \;\;\;\;\frac{{\left(\left(x + x\right) - -2\right)}^{\frac{-1}{2}} \cdot F - t\_0}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \]
    (FPCore (F B x)
      :precision binary64
      (let* ((t_0 (* (cos B) x)))
      (if (<= F -2050338190066411/19342813113834066795298816)
        (/ (+ 1 (* x (cos B))) (- (sin B)))
        (if (<= F 2)
          (/ (- (* (pow (- (+ x x) -2) -1/2) F) t_0) (sin B))
          (/ (- 1 t_0) (sin B))))))
    double code(double F, double B, double x) {
    	double t_0 = cos(B) * x;
    	double tmp;
    	if (F <= -1.06e-10) {
    		tmp = (1.0 + (x * cos(B))) / -sin(B);
    	} else if (F <= 2.0) {
    		tmp = ((pow(((x + x) - -2.0), -0.5) * F) - t_0) / sin(B);
    	} else {
    		tmp = (1.0 - t_0) / sin(B);
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(f, b, x)
    use fmin_fmax_functions
        real(8), intent (in) :: f
        real(8), intent (in) :: b
        real(8), intent (in) :: x
        real(8) :: t_0
        real(8) :: tmp
        t_0 = cos(b) * x
        if (f <= (-1.06d-10)) then
            tmp = (1.0d0 + (x * cos(b))) / -sin(b)
        else if (f <= 2.0d0) then
            tmp = (((((x + x) - (-2.0d0)) ** (-0.5d0)) * f) - t_0) / sin(b)
        else
            tmp = (1.0d0 - t_0) / sin(b)
        end if
        code = tmp
    end function
    
    public static double code(double F, double B, double x) {
    	double t_0 = Math.cos(B) * x;
    	double tmp;
    	if (F <= -1.06e-10) {
    		tmp = (1.0 + (x * Math.cos(B))) / -Math.sin(B);
    	} else if (F <= 2.0) {
    		tmp = ((Math.pow(((x + x) - -2.0), -0.5) * F) - t_0) / Math.sin(B);
    	} else {
    		tmp = (1.0 - t_0) / Math.sin(B);
    	}
    	return tmp;
    }
    
    def code(F, B, x):
    	t_0 = math.cos(B) * x
    	tmp = 0
    	if F <= -1.06e-10:
    		tmp = (1.0 + (x * math.cos(B))) / -math.sin(B)
    	elif F <= 2.0:
    		tmp = ((math.pow(((x + x) - -2.0), -0.5) * F) - t_0) / math.sin(B)
    	else:
    		tmp = (1.0 - t_0) / math.sin(B)
    	return tmp
    
    function code(F, B, x)
    	t_0 = Float64(cos(B) * x)
    	tmp = 0.0
    	if (F <= -1.06e-10)
    		tmp = Float64(Float64(1.0 + Float64(x * cos(B))) / Float64(-sin(B)));
    	elseif (F <= 2.0)
    		tmp = Float64(Float64(Float64((Float64(Float64(x + x) - -2.0) ^ -0.5) * F) - t_0) / sin(B));
    	else
    		tmp = Float64(Float64(1.0 - t_0) / sin(B));
    	end
    	return tmp
    end
    
    function tmp_2 = code(F, B, x)
    	t_0 = cos(B) * x;
    	tmp = 0.0;
    	if (F <= -1.06e-10)
    		tmp = (1.0 + (x * cos(B))) / -sin(B);
    	elseif (F <= 2.0)
    		tmp = (((((x + x) - -2.0) ^ -0.5) * F) - t_0) / sin(B);
    	else
    		tmp = (1.0 - t_0) / sin(B);
    	end
    	tmp_2 = tmp;
    end
    
    code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2050338190066411/19342813113834066795298816], N[(N[(1 + N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 2], N[(N[(N[(N[Power[N[(N[(x + x), $MachinePrecision] - -2), $MachinePrecision], -1/2], $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    t_0 := \cos B \cdot x\\
    \mathbf{if}\;F \leq \frac{-2050338190066411}{19342813113834066795298816}:\\
    \;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\
    
    \mathbf{elif}\;F \leq 2:\\
    \;\;\;\;\frac{{\left(\left(x + x\right) - -2\right)}^{\frac{-1}{2}} \cdot F - t\_0}{\sin B}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 - t\_0}{\sin B}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -1.06e-10

      1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
      5. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

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

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

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

          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
        8. lower-/.f6451.4%

          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
      6. Applied rewrites51.4%

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

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

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

          \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
        3. lower-cos.f6455.8%

          \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
      9. Applied rewrites55.8%

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

      if -1.06e-10 < F < 2

      1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        if 2 < F

        1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 6: 90.9% accurate, 1.3× speedup?

        \[\begin{array}{l} t_0 := \cos B \cdot x\\ \mathbf{if}\;F \leq -14000000000000000718667586864996145195776999603682877405921280:\\ \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\ \mathbf{elif}\;F \leq \frac{-7742953005213299}{266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B}}{\frac{1}{F}}\\ \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\ \;\;\;\;\frac{1}{\frac{\tan B}{-x}} + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \]
        (FPCore (F B x)
          :precision binary64
          (let* ((t_0 (* (cos B) x)))
          (if (<=
               F
               -14000000000000000718667586864996145195776999603682877405921280)
            (* (/ -1 (sin B)) (* (/ (+ 1 t_0) F) F))
            (if (<=
                 F
                 -7742953005213299/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072)
              (+
               (- (/ x B))
               (/ (/ (pow (- (+ x x) (- -2 (* F F))) -1/2) (sin B)) (/ 1 F)))
              (if (<= F 713053462628379/158456325028528675187087900672)
                (+
                 (/ 1 (/ (tan B) (- x)))
                 (* (/ F B) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2)))))
                (/ (- 1 t_0) (sin B)))))))
        double code(double F, double B, double x) {
        	double t_0 = cos(B) * x;
        	double tmp;
        	if (F <= -1.4e+61) {
        		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
        	} else if (F <= -2.9e-80) {
        		tmp = -(x / B) + ((pow(((x + x) - (-2.0 - (F * F))), -0.5) / sin(B)) / (1.0 / F));
        	} else if (F <= 4.5e-15) {
        		tmp = (1.0 / (tan(B) / -x)) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
        	} else {
        		tmp = (1.0 - t_0) / sin(B);
        	}
        	return tmp;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(f, b, x)
        use fmin_fmax_functions
            real(8), intent (in) :: f
            real(8), intent (in) :: b
            real(8), intent (in) :: x
            real(8) :: t_0
            real(8) :: tmp
            t_0 = cos(b) * x
            if (f <= (-1.4d+61)) then
                tmp = ((-1.0d0) / sin(b)) * (((1.0d0 + t_0) / f) * f)
            else if (f <= (-2.9d-80)) then
                tmp = -(x / b) + (((((x + x) - ((-2.0d0) - (f * f))) ** (-0.5d0)) / sin(b)) / (1.0d0 / f))
            else if (f <= 4.5d-15) then
                tmp = (1.0d0 / (tan(b) / -x)) + ((f / b) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
            else
                tmp = (1.0d0 - t_0) / sin(b)
            end if
            code = tmp
        end function
        
        public static double code(double F, double B, double x) {
        	double t_0 = Math.cos(B) * x;
        	double tmp;
        	if (F <= -1.4e+61) {
        		tmp = (-1.0 / Math.sin(B)) * (((1.0 + t_0) / F) * F);
        	} else if (F <= -2.9e-80) {
        		tmp = -(x / B) + ((Math.pow(((x + x) - (-2.0 - (F * F))), -0.5) / Math.sin(B)) / (1.0 / F));
        	} else if (F <= 4.5e-15) {
        		tmp = (1.0 / (Math.tan(B) / -x)) + ((F / B) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
        	} else {
        		tmp = (1.0 - t_0) / Math.sin(B);
        	}
        	return tmp;
        }
        
        def code(F, B, x):
        	t_0 = math.cos(B) * x
        	tmp = 0
        	if F <= -1.4e+61:
        		tmp = (-1.0 / math.sin(B)) * (((1.0 + t_0) / F) * F)
        	elif F <= -2.9e-80:
        		tmp = -(x / B) + ((math.pow(((x + x) - (-2.0 - (F * F))), -0.5) / math.sin(B)) / (1.0 / F))
        	elif F <= 4.5e-15:
        		tmp = (1.0 / (math.tan(B) / -x)) + ((F / B) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
        	else:
        		tmp = (1.0 - t_0) / math.sin(B)
        	return tmp
        
        function code(F, B, x)
        	t_0 = Float64(cos(B) * x)
        	tmp = 0.0
        	if (F <= -1.4e+61)
        		tmp = Float64(Float64(-1.0 / sin(B)) * Float64(Float64(Float64(1.0 + t_0) / F) * F));
        	elseif (F <= -2.9e-80)
        		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64((Float64(Float64(x + x) - Float64(-2.0 - Float64(F * F))) ^ -0.5) / sin(B)) / Float64(1.0 / F)));
        	elseif (F <= 4.5e-15)
        		tmp = Float64(Float64(1.0 / Float64(tan(B) / Float64(-x))) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
        	else
        		tmp = Float64(Float64(1.0 - t_0) / sin(B));
        	end
        	return tmp
        end
        
        function tmp_2 = code(F, B, x)
        	t_0 = cos(B) * x;
        	tmp = 0.0;
        	if (F <= -1.4e+61)
        		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
        	elseif (F <= -2.9e-80)
        		tmp = -(x / B) + (((((x + x) - (-2.0 - (F * F))) ^ -0.5) / sin(B)) / (1.0 / F));
        	elseif (F <= 4.5e-15)
        		tmp = (1.0 / (tan(B) / -x)) + ((F / B) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
        	else
        		tmp = (1.0 - t_0) / sin(B);
        	end
        	tmp_2 = tmp;
        end
        
        code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -14000000000000000718667586864996145195776999603682877405921280], N[(N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1 + t$95$0), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7742953005213299/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[Power[N[(N[(x + x), $MachinePrecision] - N[(-2 - N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[(1 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 713053462628379/158456325028528675187087900672], N[(N[(1 / N[(N[Tan[B], $MachinePrecision] / (-x)), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2), $MachinePrecision] + N[(2 * x), $MachinePrecision]), $MachinePrecision], (-N[(1 / 2), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
        
        \begin{array}{l}
        t_0 := \cos B \cdot x\\
        \mathbf{if}\;F \leq -14000000000000000718667586864996145195776999603682877405921280:\\
        \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\
        
        \mathbf{elif}\;F \leq \frac{-7742953005213299}{266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072}:\\
        \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B}}{\frac{1}{F}}\\
        
        \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\
        \;\;\;\;\frac{1}{\frac{\tan B}{-x}} + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{1 - t\_0}{\sin B}\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if F < -1.4000000000000001e61

          1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
          5. Step-by-step derivation
            1. lower-*.f64N/A

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

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

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

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

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

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

              \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
            8. lower-/.f6451.4%

              \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
          6. Applied rewrites51.4%

            \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
          7. Applied rewrites51.4%

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

          if -1.4000000000000001e61 < F < -2.9e-80

          1. Initial program 76.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. Taylor expanded in B around 0

            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          3. Step-by-step derivation
            1. lower-/.f6449.2%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}{\frac{1}{F}}} \]
          6. Applied rewrites57.3%

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

          if -2.9e-80 < F < 4.4999999999999998e-15

          1. Initial program 76.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. Taylor expanded in B around 0

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          4. Applied rewrites62.4%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{1}{\frac{\tan B}{-x}}} + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            11. lower-unsound-/.f6462.4%

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

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

          if 4.4999999999999998e-15 < F

          1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 7: 90.9% accurate, 1.3× speedup?

          \[\begin{array}{l} t_0 := \cos B \cdot x\\ \mathbf{if}\;F \leq -14000000000000000718667586864996145195776999603682877405921280:\\ \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\ \mathbf{elif}\;F \leq \frac{-7742953005213299}{266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B}}{\frac{1}{F}}\\ \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \]
          (FPCore (F B x)
            :precision binary64
            (let* ((t_0 (* (cos B) x)))
            (if (<=
                 F
                 -14000000000000000718667586864996145195776999603682877405921280)
              (* (/ -1 (sin B)) (* (/ (+ 1 t_0) F) F))
              (if (<=
                   F
                   -7742953005213299/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072)
                (+
                 (- (/ x B))
                 (/ (/ (pow (- (+ x x) (- -2 (* F F))) -1/2) (sin B)) (/ 1 F)))
                (if (<= F 713053462628379/158456325028528675187087900672)
                  (+
                   (- (* x (/ 1 (tan B))))
                   (* (/ F B) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2)))))
                  (/ (- 1 t_0) (sin B)))))))
          double code(double F, double B, double x) {
          	double t_0 = cos(B) * x;
          	double tmp;
          	if (F <= -1.4e+61) {
          		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
          	} else if (F <= -2.9e-80) {
          		tmp = -(x / B) + ((pow(((x + x) - (-2.0 - (F * F))), -0.5) / sin(B)) / (1.0 / F));
          	} else if (F <= 4.5e-15) {
          		tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
          	} else {
          		tmp = (1.0 - t_0) / sin(B);
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(f, b, x)
          use fmin_fmax_functions
              real(8), intent (in) :: f
              real(8), intent (in) :: b
              real(8), intent (in) :: x
              real(8) :: t_0
              real(8) :: tmp
              t_0 = cos(b) * x
              if (f <= (-1.4d+61)) then
                  tmp = ((-1.0d0) / sin(b)) * (((1.0d0 + t_0) / f) * f)
              else if (f <= (-2.9d-80)) then
                  tmp = -(x / b) + (((((x + x) - ((-2.0d0) - (f * f))) ** (-0.5d0)) / sin(b)) / (1.0d0 / f))
              else if (f <= 4.5d-15) then
                  tmp = -(x * (1.0d0 / tan(b))) + ((f / b) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
              else
                  tmp = (1.0d0 - t_0) / sin(b)
              end if
              code = tmp
          end function
          
          public static double code(double F, double B, double x) {
          	double t_0 = Math.cos(B) * x;
          	double tmp;
          	if (F <= -1.4e+61) {
          		tmp = (-1.0 / Math.sin(B)) * (((1.0 + t_0) / F) * F);
          	} else if (F <= -2.9e-80) {
          		tmp = -(x / B) + ((Math.pow(((x + x) - (-2.0 - (F * F))), -0.5) / Math.sin(B)) / (1.0 / F));
          	} else if (F <= 4.5e-15) {
          		tmp = -(x * (1.0 / Math.tan(B))) + ((F / B) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
          	} else {
          		tmp = (1.0 - t_0) / Math.sin(B);
          	}
          	return tmp;
          }
          
          def code(F, B, x):
          	t_0 = math.cos(B) * x
          	tmp = 0
          	if F <= -1.4e+61:
          		tmp = (-1.0 / math.sin(B)) * (((1.0 + t_0) / F) * F)
          	elif F <= -2.9e-80:
          		tmp = -(x / B) + ((math.pow(((x + x) - (-2.0 - (F * F))), -0.5) / math.sin(B)) / (1.0 / F))
          	elif F <= 4.5e-15:
          		tmp = -(x * (1.0 / math.tan(B))) + ((F / B) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
          	else:
          		tmp = (1.0 - t_0) / math.sin(B)
          	return tmp
          
          function code(F, B, x)
          	t_0 = Float64(cos(B) * x)
          	tmp = 0.0
          	if (F <= -1.4e+61)
          		tmp = Float64(Float64(-1.0 / sin(B)) * Float64(Float64(Float64(1.0 + t_0) / F) * F));
          	elseif (F <= -2.9e-80)
          		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64((Float64(Float64(x + x) - Float64(-2.0 - Float64(F * F))) ^ -0.5) / sin(B)) / Float64(1.0 / F)));
          	elseif (F <= 4.5e-15)
          		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
          	else
          		tmp = Float64(Float64(1.0 - t_0) / sin(B));
          	end
          	return tmp
          end
          
          function tmp_2 = code(F, B, x)
          	t_0 = cos(B) * x;
          	tmp = 0.0;
          	if (F <= -1.4e+61)
          		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
          	elseif (F <= -2.9e-80)
          		tmp = -(x / B) + (((((x + x) - (-2.0 - (F * F))) ^ -0.5) / sin(B)) / (1.0 / F));
          	elseif (F <= 4.5e-15)
          		tmp = -(x * (1.0 / tan(B))) + ((F / B) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
          	else
          		tmp = (1.0 - t_0) / sin(B);
          	end
          	tmp_2 = tmp;
          end
          
          code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -14000000000000000718667586864996145195776999603682877405921280], N[(N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1 + t$95$0), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7742953005213299/266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[Power[N[(N[(x + x), $MachinePrecision] - N[(-2 - N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[(1 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 713053462628379/158456325028528675187087900672], N[((-N[(x * N[(1 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2), $MachinePrecision] + N[(2 * x), $MachinePrecision]), $MachinePrecision], (-N[(1 / 2), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
          
          \begin{array}{l}
          t_0 := \cos B \cdot x\\
          \mathbf{if}\;F \leq -14000000000000000718667586864996145195776999603682877405921280:\\
          \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\
          
          \mathbf{elif}\;F \leq \frac{-7742953005213299}{266998379490113760299377713271194014325338065294581596243380200977777465722580068752870260867072}:\\
          \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B}}{\frac{1}{F}}\\
          
          \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\
          \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{1 - t\_0}{\sin B}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if F < -1.4000000000000001e61

            1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

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

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

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

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

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

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

                \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
              8. lower-/.f6451.4%

                \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
            6. Applied rewrites51.4%

              \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
            7. Applied rewrites51.4%

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

            if -1.4000000000000001e61 < F < -2.9e-80

            1. Initial program 76.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. Taylor expanded in B around 0

              \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            3. Step-by-step derivation
              1. lower-/.f6449.2%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}{\frac{1}{F}}} \]
            6. Applied rewrites57.3%

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

            if -2.9e-80 < F < 4.4999999999999998e-15

            1. Initial program 76.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. Taylor expanded in B around 0

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            4. Applied rewrites62.4%

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

            if 4.4999999999999998e-15 < F

            1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 8: 88.7% accurate, 1.3× speedup?

            \[\begin{array}{l} t_0 := \cos B \cdot x\\ t_1 := -\frac{x}{B}\\ t_2 := {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}\\ t_3 := t\_2 \cdot F\\ \mathbf{if}\;F \leq -14000000000000000718667586864996145195776999603682877405921280:\\ \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\ \mathbf{elif}\;F \leq \frac{-1196547670217613}{1087770609288739018116276647019455748771006705104961378712461595034426490595025393129804804639189577049885346787832834079429794483512744426310696916513970896780966442670885312576979206144}:\\ \;\;\;\;t\_1 + \frac{\frac{t\_2}{\sin B}}{\frac{1}{F}}\\ \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\ \;\;\;\;\frac{\frac{-x}{\tan B} \cdot \left(-1 \cdot B\right) - t\_3}{-1 \cdot B}\\ \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\ \;\;\;\;t\_1 + \frac{1}{\sin B} \cdot t\_3\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \]
            (FPCore (F B x)
              :precision binary64
              (let* ((t_0 (* (cos B) x))
                   (t_1 (- (/ x B)))
                   (t_2 (pow (- (+ x x) (- -2 (* F F))) -1/2))
                   (t_3 (* t_2 F)))
              (if (<=
                   F
                   -14000000000000000718667586864996145195776999603682877405921280)
                (* (/ -1 (sin B)) (* (/ (+ 1 t_0) F) F))
                (if (<=
                     F
                     -1196547670217613/1087770609288739018116276647019455748771006705104961378712461595034426490595025393129804804639189577049885346787832834079429794483512744426310696916513970896780966442670885312576979206144)
                  (+ t_1 (/ (/ t_2 (sin B)) (/ 1 F)))
                  (if (<=
                       F
                       7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968)
                    (/ (- (* (/ (- x) (tan B)) (* -1 B)) t_3) (* -1 B))
                    (if (<= F 713053462628379/158456325028528675187087900672)
                      (+ t_1 (* (/ 1 (sin B)) t_3))
                      (/ (- 1 t_0) (sin B))))))))
            double code(double F, double B, double x) {
            	double t_0 = cos(B) * x;
            	double t_1 = -(x / B);
            	double t_2 = pow(((x + x) - (-2.0 - (F * F))), -0.5);
            	double t_3 = t_2 * F;
            	double tmp;
            	if (F <= -1.4e+61) {
            		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
            	} else if (F <= -1.1e-171) {
            		tmp = t_1 + ((t_2 / sin(B)) / (1.0 / F));
            	} else if (F <= 7.8e-122) {
            		tmp = (((-x / tan(B)) * (-1.0 * B)) - t_3) / (-1.0 * B);
            	} else if (F <= 4.5e-15) {
            		tmp = t_1 + ((1.0 / sin(B)) * t_3);
            	} else {
            		tmp = (1.0 - t_0) / sin(B);
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(f, b, x)
            use fmin_fmax_functions
                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) :: t_2
                real(8) :: t_3
                real(8) :: tmp
                t_0 = cos(b) * x
                t_1 = -(x / b)
                t_2 = ((x + x) - ((-2.0d0) - (f * f))) ** (-0.5d0)
                t_3 = t_2 * f
                if (f <= (-1.4d+61)) then
                    tmp = ((-1.0d0) / sin(b)) * (((1.0d0 + t_0) / f) * f)
                else if (f <= (-1.1d-171)) then
                    tmp = t_1 + ((t_2 / sin(b)) / (1.0d0 / f))
                else if (f <= 7.8d-122) then
                    tmp = (((-x / tan(b)) * ((-1.0d0) * b)) - t_3) / ((-1.0d0) * b)
                else if (f <= 4.5d-15) then
                    tmp = t_1 + ((1.0d0 / sin(b)) * t_3)
                else
                    tmp = (1.0d0 - t_0) / sin(b)
                end if
                code = tmp
            end function
            
            public static double code(double F, double B, double x) {
            	double t_0 = Math.cos(B) * x;
            	double t_1 = -(x / B);
            	double t_2 = Math.pow(((x + x) - (-2.0 - (F * F))), -0.5);
            	double t_3 = t_2 * F;
            	double tmp;
            	if (F <= -1.4e+61) {
            		tmp = (-1.0 / Math.sin(B)) * (((1.0 + t_0) / F) * F);
            	} else if (F <= -1.1e-171) {
            		tmp = t_1 + ((t_2 / Math.sin(B)) / (1.0 / F));
            	} else if (F <= 7.8e-122) {
            		tmp = (((-x / Math.tan(B)) * (-1.0 * B)) - t_3) / (-1.0 * B);
            	} else if (F <= 4.5e-15) {
            		tmp = t_1 + ((1.0 / Math.sin(B)) * t_3);
            	} else {
            		tmp = (1.0 - t_0) / Math.sin(B);
            	}
            	return tmp;
            }
            
            def code(F, B, x):
            	t_0 = math.cos(B) * x
            	t_1 = -(x / B)
            	t_2 = math.pow(((x + x) - (-2.0 - (F * F))), -0.5)
            	t_3 = t_2 * F
            	tmp = 0
            	if F <= -1.4e+61:
            		tmp = (-1.0 / math.sin(B)) * (((1.0 + t_0) / F) * F)
            	elif F <= -1.1e-171:
            		tmp = t_1 + ((t_2 / math.sin(B)) / (1.0 / F))
            	elif F <= 7.8e-122:
            		tmp = (((-x / math.tan(B)) * (-1.0 * B)) - t_3) / (-1.0 * B)
            	elif F <= 4.5e-15:
            		tmp = t_1 + ((1.0 / math.sin(B)) * t_3)
            	else:
            		tmp = (1.0 - t_0) / math.sin(B)
            	return tmp
            
            function code(F, B, x)
            	t_0 = Float64(cos(B) * x)
            	t_1 = Float64(-Float64(x / B))
            	t_2 = Float64(Float64(x + x) - Float64(-2.0 - Float64(F * F))) ^ -0.5
            	t_3 = Float64(t_2 * F)
            	tmp = 0.0
            	if (F <= -1.4e+61)
            		tmp = Float64(Float64(-1.0 / sin(B)) * Float64(Float64(Float64(1.0 + t_0) / F) * F));
            	elseif (F <= -1.1e-171)
            		tmp = Float64(t_1 + Float64(Float64(t_2 / sin(B)) / Float64(1.0 / F)));
            	elseif (F <= 7.8e-122)
            		tmp = Float64(Float64(Float64(Float64(Float64(-x) / tan(B)) * Float64(-1.0 * B)) - t_3) / Float64(-1.0 * B));
            	elseif (F <= 4.5e-15)
            		tmp = Float64(t_1 + Float64(Float64(1.0 / sin(B)) * t_3));
            	else
            		tmp = Float64(Float64(1.0 - t_0) / sin(B));
            	end
            	return tmp
            end
            
            function tmp_2 = code(F, B, x)
            	t_0 = cos(B) * x;
            	t_1 = -(x / B);
            	t_2 = ((x + x) - (-2.0 - (F * F))) ^ -0.5;
            	t_3 = t_2 * F;
            	tmp = 0.0;
            	if (F <= -1.4e+61)
            		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
            	elseif (F <= -1.1e-171)
            		tmp = t_1 + ((t_2 / sin(B)) / (1.0 / F));
            	elseif (F <= 7.8e-122)
            		tmp = (((-x / tan(B)) * (-1.0 * B)) - t_3) / (-1.0 * B);
            	elseif (F <= 4.5e-15)
            		tmp = t_1 + ((1.0 / sin(B)) * t_3);
            	else
            		tmp = (1.0 - t_0) / sin(B);
            	end
            	tmp_2 = tmp;
            end
            
            code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$2 = N[Power[N[(N[(x + x), $MachinePrecision] - N[(-2 - N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * F), $MachinePrecision]}, If[LessEqual[F, -14000000000000000718667586864996145195776999603682877405921280], N[(N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1 + t$95$0), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1196547670217613/1087770609288739018116276647019455748771006705104961378712461595034426490595025393129804804639189577049885346787832834079429794483512744426310696916513970896780966442670885312576979206144], N[(t$95$1 + N[(N[(t$95$2 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[(1 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968], N[(N[(N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] * N[(-1 * B), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision] / N[(-1 * B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 713053462628379/158456325028528675187087900672], N[(t$95$1 + N[(N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(1 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]]]
            
            \begin{array}{l}
            t_0 := \cos B \cdot x\\
            t_1 := -\frac{x}{B}\\
            t_2 := {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}\\
            t_3 := t\_2 \cdot F\\
            \mathbf{if}\;F \leq -14000000000000000718667586864996145195776999603682877405921280:\\
            \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\
            
            \mathbf{elif}\;F \leq \frac{-1196547670217613}{1087770609288739018116276647019455748771006705104961378712461595034426490595025393129804804639189577049885346787832834079429794483512744426310696916513970896780966442670885312576979206144}:\\
            \;\;\;\;t\_1 + \frac{\frac{t\_2}{\sin B}}{\frac{1}{F}}\\
            
            \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\
            \;\;\;\;\frac{\frac{-x}{\tan B} \cdot \left(-1 \cdot B\right) - t\_3}{-1 \cdot B}\\
            
            \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\
            \;\;\;\;t\_1 + \frac{1}{\sin B} \cdot t\_3\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{1 - t\_0}{\sin B}\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 5 regimes
            2. if F < -1.4000000000000001e61

              1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
              5. Step-by-step derivation
                1. lower-*.f64N/A

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

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

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

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

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

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

                  \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                8. lower-/.f6451.4%

                  \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
              6. Applied rewrites51.4%

                \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
              7. Applied rewrites51.4%

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

              if -1.4000000000000001e61 < F < -1.1000000000000001e-171

              1. Initial program 76.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. Taylor expanded in B around 0

                \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              3. Step-by-step derivation
                1. lower-/.f6449.2%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}{\frac{1}{F}}} \]
              6. Applied rewrites57.3%

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

              if -1.1000000000000001e-171 < F < 7.7999999999999998e-122

              1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{-x}{\tan B} \cdot \color{blue}{\left(-1 \cdot B\right)} - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B} \]
              5. Step-by-step derivation
                1. lower-*.f6448.9%

                  \[\leadsto \frac{\frac{-x}{\tan B} \cdot \left(-1 \cdot \color{blue}{B}\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B} \]
              6. Applied rewrites48.9%

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

                \[\leadsto \frac{\frac{-x}{\tan B} \cdot \left(-1 \cdot B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{\color{blue}{-1 \cdot B}} \]
              8. Step-by-step derivation
                1. lower-*.f6460.9%

                  \[\leadsto \frac{\frac{-x}{\tan B} \cdot \left(-1 \cdot B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-1 \cdot \color{blue}{B}} \]
              9. Applied rewrites60.9%

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

              if 7.7999999999999998e-122 < F < 4.4999999999999998e-15

              1. Initial program 76.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. Taylor expanded in B around 0

                \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              3. Step-by-step derivation
                1. lower-/.f6449.2%

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

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

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

              if 4.4999999999999998e-15 < F

              1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 9: 88.3% accurate, 1.3× speedup?

              \[\begin{array}{l} t_0 := \cos B \cdot x\\ t_1 := -\frac{x}{B}\\ t_2 := {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}\\ t_3 := t\_2 \cdot F\\ \mathbf{if}\;F \leq -130000000000000003301073569777188864:\\ \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\ \mathbf{elif}\;F \leq \frac{-1196547670217613}{1087770609288739018116276647019455748771006705104961378712461595034426490595025393129804804639189577049885346787832834079429794483512744426310696916513970896780966442670885312576979206144}:\\ \;\;\;\;t\_1 + \frac{t\_2}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\ \;\;\;\;\frac{\frac{-x}{\tan B} \cdot \left(-1 \cdot B\right) - t\_3}{-1 \cdot B}\\ \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\ \;\;\;\;t\_1 + \frac{1}{\sin B} \cdot t\_3\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \]
              (FPCore (F B x)
                :precision binary64
                (let* ((t_0 (* (cos B) x))
                     (t_1 (- (/ x B)))
                     (t_2 (pow (- (+ x x) (- -2 (* F F))) -1/2))
                     (t_3 (* t_2 F)))
                (if (<= F -130000000000000003301073569777188864)
                  (* (/ -1 (sin B)) (* (/ (+ 1 t_0) F) F))
                  (if (<=
                       F
                       -1196547670217613/1087770609288739018116276647019455748771006705104961378712461595034426490595025393129804804639189577049885346787832834079429794483512744426310696916513970896780966442670885312576979206144)
                    (+ t_1 (/ t_2 (/ (sin B) F)))
                    (if (<=
                         F
                         7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968)
                      (/ (- (* (/ (- x) (tan B)) (* -1 B)) t_3) (* -1 B))
                      (if (<= F 713053462628379/158456325028528675187087900672)
                        (+ t_1 (* (/ 1 (sin B)) t_3))
                        (/ (- 1 t_0) (sin B))))))))
              double code(double F, double B, double x) {
              	double t_0 = cos(B) * x;
              	double t_1 = -(x / B);
              	double t_2 = pow(((x + x) - (-2.0 - (F * F))), -0.5);
              	double t_3 = t_2 * F;
              	double tmp;
              	if (F <= -1.3e+35) {
              		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
              	} else if (F <= -1.1e-171) {
              		tmp = t_1 + (t_2 / (sin(B) / F));
              	} else if (F <= 7.8e-122) {
              		tmp = (((-x / tan(B)) * (-1.0 * B)) - t_3) / (-1.0 * B);
              	} else if (F <= 4.5e-15) {
              		tmp = t_1 + ((1.0 / sin(B)) * t_3);
              	} else {
              		tmp = (1.0 - t_0) / sin(B);
              	}
              	return tmp;
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(f, b, x)
              use fmin_fmax_functions
                  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) :: t_2
                  real(8) :: t_3
                  real(8) :: tmp
                  t_0 = cos(b) * x
                  t_1 = -(x / b)
                  t_2 = ((x + x) - ((-2.0d0) - (f * f))) ** (-0.5d0)
                  t_3 = t_2 * f
                  if (f <= (-1.3d+35)) then
                      tmp = ((-1.0d0) / sin(b)) * (((1.0d0 + t_0) / f) * f)
                  else if (f <= (-1.1d-171)) then
                      tmp = t_1 + (t_2 / (sin(b) / f))
                  else if (f <= 7.8d-122) then
                      tmp = (((-x / tan(b)) * ((-1.0d0) * b)) - t_3) / ((-1.0d0) * b)
                  else if (f <= 4.5d-15) then
                      tmp = t_1 + ((1.0d0 / sin(b)) * t_3)
                  else
                      tmp = (1.0d0 - t_0) / sin(b)
                  end if
                  code = tmp
              end function
              
              public static double code(double F, double B, double x) {
              	double t_0 = Math.cos(B) * x;
              	double t_1 = -(x / B);
              	double t_2 = Math.pow(((x + x) - (-2.0 - (F * F))), -0.5);
              	double t_3 = t_2 * F;
              	double tmp;
              	if (F <= -1.3e+35) {
              		tmp = (-1.0 / Math.sin(B)) * (((1.0 + t_0) / F) * F);
              	} else if (F <= -1.1e-171) {
              		tmp = t_1 + (t_2 / (Math.sin(B) / F));
              	} else if (F <= 7.8e-122) {
              		tmp = (((-x / Math.tan(B)) * (-1.0 * B)) - t_3) / (-1.0 * B);
              	} else if (F <= 4.5e-15) {
              		tmp = t_1 + ((1.0 / Math.sin(B)) * t_3);
              	} else {
              		tmp = (1.0 - t_0) / Math.sin(B);
              	}
              	return tmp;
              }
              
              def code(F, B, x):
              	t_0 = math.cos(B) * x
              	t_1 = -(x / B)
              	t_2 = math.pow(((x + x) - (-2.0 - (F * F))), -0.5)
              	t_3 = t_2 * F
              	tmp = 0
              	if F <= -1.3e+35:
              		tmp = (-1.0 / math.sin(B)) * (((1.0 + t_0) / F) * F)
              	elif F <= -1.1e-171:
              		tmp = t_1 + (t_2 / (math.sin(B) / F))
              	elif F <= 7.8e-122:
              		tmp = (((-x / math.tan(B)) * (-1.0 * B)) - t_3) / (-1.0 * B)
              	elif F <= 4.5e-15:
              		tmp = t_1 + ((1.0 / math.sin(B)) * t_3)
              	else:
              		tmp = (1.0 - t_0) / math.sin(B)
              	return tmp
              
              function code(F, B, x)
              	t_0 = Float64(cos(B) * x)
              	t_1 = Float64(-Float64(x / B))
              	t_2 = Float64(Float64(x + x) - Float64(-2.0 - Float64(F * F))) ^ -0.5
              	t_3 = Float64(t_2 * F)
              	tmp = 0.0
              	if (F <= -1.3e+35)
              		tmp = Float64(Float64(-1.0 / sin(B)) * Float64(Float64(Float64(1.0 + t_0) / F) * F));
              	elseif (F <= -1.1e-171)
              		tmp = Float64(t_1 + Float64(t_2 / Float64(sin(B) / F)));
              	elseif (F <= 7.8e-122)
              		tmp = Float64(Float64(Float64(Float64(Float64(-x) / tan(B)) * Float64(-1.0 * B)) - t_3) / Float64(-1.0 * B));
              	elseif (F <= 4.5e-15)
              		tmp = Float64(t_1 + Float64(Float64(1.0 / sin(B)) * t_3));
              	else
              		tmp = Float64(Float64(1.0 - t_0) / sin(B));
              	end
              	return tmp
              end
              
              function tmp_2 = code(F, B, x)
              	t_0 = cos(B) * x;
              	t_1 = -(x / B);
              	t_2 = ((x + x) - (-2.0 - (F * F))) ^ -0.5;
              	t_3 = t_2 * F;
              	tmp = 0.0;
              	if (F <= -1.3e+35)
              		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
              	elseif (F <= -1.1e-171)
              		tmp = t_1 + (t_2 / (sin(B) / F));
              	elseif (F <= 7.8e-122)
              		tmp = (((-x / tan(B)) * (-1.0 * B)) - t_3) / (-1.0 * B);
              	elseif (F <= 4.5e-15)
              		tmp = t_1 + ((1.0 / sin(B)) * t_3);
              	else
              		tmp = (1.0 - t_0) / sin(B);
              	end
              	tmp_2 = tmp;
              end
              
              code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$2 = N[Power[N[(N[(x + x), $MachinePrecision] - N[(-2 - N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * F), $MachinePrecision]}, If[LessEqual[F, -130000000000000003301073569777188864], N[(N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1 + t$95$0), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1196547670217613/1087770609288739018116276647019455748771006705104961378712461595034426490595025393129804804639189577049885346787832834079429794483512744426310696916513970896780966442670885312576979206144], N[(t$95$1 + N[(t$95$2 / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968], N[(N[(N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] * N[(-1 * B), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision] / N[(-1 * B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 713053462628379/158456325028528675187087900672], N[(t$95$1 + N[(N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(1 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]]]
              
              \begin{array}{l}
              t_0 := \cos B \cdot x\\
              t_1 := -\frac{x}{B}\\
              t_2 := {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}\\
              t_3 := t\_2 \cdot F\\
              \mathbf{if}\;F \leq -130000000000000003301073569777188864:\\
              \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\
              
              \mathbf{elif}\;F \leq \frac{-1196547670217613}{1087770609288739018116276647019455748771006705104961378712461595034426490595025393129804804639189577049885346787832834079429794483512744426310696916513970896780966442670885312576979206144}:\\
              \;\;\;\;t\_1 + \frac{t\_2}{\frac{\sin B}{F}}\\
              
              \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\
              \;\;\;\;\frac{\frac{-x}{\tan B} \cdot \left(-1 \cdot B\right) - t\_3}{-1 \cdot B}\\
              
              \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\
              \;\;\;\;t\_1 + \frac{1}{\sin B} \cdot t\_3\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{1 - t\_0}{\sin B}\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 5 regimes
              2. if F < -1.3e35

                1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                5. Step-by-step derivation
                  1. lower-*.f64N/A

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

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

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

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

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

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

                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                  8. lower-/.f6451.4%

                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                6. Applied rewrites51.4%

                  \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                7. Applied rewrites51.4%

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

                if -1.3e35 < F < -1.1000000000000001e-171

                1. Initial program 76.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. Taylor expanded in B around 0

                  \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                3. Step-by-step derivation
                  1. lower-/.f6449.2%

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

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

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

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

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

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

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

                    \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\frac{\sin B}{F}}} \]
                  7. lower-/.f6450.1%

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

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

                if -1.1000000000000001e-171 < F < 7.7999999999999998e-122

                1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\frac{-x}{\tan B} \cdot \color{blue}{\left(-1 \cdot B\right)} - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B} \]
                5. Step-by-step derivation
                  1. lower-*.f6448.9%

                    \[\leadsto \frac{\frac{-x}{\tan B} \cdot \left(-1 \cdot \color{blue}{B}\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B} \]
                6. Applied rewrites48.9%

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

                  \[\leadsto \frac{\frac{-x}{\tan B} \cdot \left(-1 \cdot B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{\color{blue}{-1 \cdot B}} \]
                8. Step-by-step derivation
                  1. lower-*.f6460.9%

                    \[\leadsto \frac{\frac{-x}{\tan B} \cdot \left(-1 \cdot B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-1 \cdot \color{blue}{B}} \]
                9. Applied rewrites60.9%

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

                if 7.7999999999999998e-122 < F < 4.4999999999999998e-15

                1. Initial program 76.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. Taylor expanded in B around 0

                  \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                3. Step-by-step derivation
                  1. lower-/.f6449.2%

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

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

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

                if 4.4999999999999998e-15 < F

                1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 10: 87.3% accurate, 1.3× speedup?

                \[\begin{array}{l} t_0 := \cos B \cdot x\\ t_1 := -\frac{x}{B}\\ t_2 := {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}\\ \mathbf{if}\;F \leq -130000000000000003301073569777188864:\\ \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\ \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\ \;\;\;\;t\_1 + \frac{t\_2}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\ \;\;\;\;t\_1 + \frac{1}{\sin B} \cdot \left(t\_2 \cdot F\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \]
                (FPCore (F B x)
                  :precision binary64
                  (let* ((t_0 (* (cos B) x))
                       (t_1 (- (/ x B)))
                       (t_2 (pow (- (+ x x) (- -2 (* F F))) -1/2)))
                  (if (<= F -130000000000000003301073569777188864)
                    (* (/ -1 (sin B)) (* (/ (+ 1 t_0) F) F))
                    (if (<=
                         F
                         -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512)
                      (+ t_1 (/ t_2 (/ (sin B) F)))
                      (if (<=
                           F
                           7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968)
                        (/ (- x) (tan B))
                        (if (<= F 713053462628379/158456325028528675187087900672)
                          (+ t_1 (* (/ 1 (sin B)) (* t_2 F)))
                          (/ (- 1 t_0) (sin B))))))))
                double code(double F, double B, double x) {
                	double t_0 = cos(B) * x;
                	double t_1 = -(x / B);
                	double t_2 = pow(((x + x) - (-2.0 - (F * F))), -0.5);
                	double tmp;
                	if (F <= -1.3e+35) {
                		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
                	} else if (F <= -8.2e-259) {
                		tmp = t_1 + (t_2 / (sin(B) / F));
                	} else if (F <= 7.8e-122) {
                		tmp = -x / tan(B);
                	} else if (F <= 4.5e-15) {
                		tmp = t_1 + ((1.0 / sin(B)) * (t_2 * F));
                	} else {
                		tmp = (1.0 - t_0) / sin(B);
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(f, b, x)
                use fmin_fmax_functions
                    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) :: t_2
                    real(8) :: tmp
                    t_0 = cos(b) * x
                    t_1 = -(x / b)
                    t_2 = ((x + x) - ((-2.0d0) - (f * f))) ** (-0.5d0)
                    if (f <= (-1.3d+35)) then
                        tmp = ((-1.0d0) / sin(b)) * (((1.0d0 + t_0) / f) * f)
                    else if (f <= (-8.2d-259)) then
                        tmp = t_1 + (t_2 / (sin(b) / f))
                    else if (f <= 7.8d-122) then
                        tmp = -x / tan(b)
                    else if (f <= 4.5d-15) then
                        tmp = t_1 + ((1.0d0 / sin(b)) * (t_2 * f))
                    else
                        tmp = (1.0d0 - t_0) / sin(b)
                    end if
                    code = tmp
                end function
                
                public static double code(double F, double B, double x) {
                	double t_0 = Math.cos(B) * x;
                	double t_1 = -(x / B);
                	double t_2 = Math.pow(((x + x) - (-2.0 - (F * F))), -0.5);
                	double tmp;
                	if (F <= -1.3e+35) {
                		tmp = (-1.0 / Math.sin(B)) * (((1.0 + t_0) / F) * F);
                	} else if (F <= -8.2e-259) {
                		tmp = t_1 + (t_2 / (Math.sin(B) / F));
                	} else if (F <= 7.8e-122) {
                		tmp = -x / Math.tan(B);
                	} else if (F <= 4.5e-15) {
                		tmp = t_1 + ((1.0 / Math.sin(B)) * (t_2 * F));
                	} else {
                		tmp = (1.0 - t_0) / Math.sin(B);
                	}
                	return tmp;
                }
                
                def code(F, B, x):
                	t_0 = math.cos(B) * x
                	t_1 = -(x / B)
                	t_2 = math.pow(((x + x) - (-2.0 - (F * F))), -0.5)
                	tmp = 0
                	if F <= -1.3e+35:
                		tmp = (-1.0 / math.sin(B)) * (((1.0 + t_0) / F) * F)
                	elif F <= -8.2e-259:
                		tmp = t_1 + (t_2 / (math.sin(B) / F))
                	elif F <= 7.8e-122:
                		tmp = -x / math.tan(B)
                	elif F <= 4.5e-15:
                		tmp = t_1 + ((1.0 / math.sin(B)) * (t_2 * F))
                	else:
                		tmp = (1.0 - t_0) / math.sin(B)
                	return tmp
                
                function code(F, B, x)
                	t_0 = Float64(cos(B) * x)
                	t_1 = Float64(-Float64(x / B))
                	t_2 = Float64(Float64(x + x) - Float64(-2.0 - Float64(F * F))) ^ -0.5
                	tmp = 0.0
                	if (F <= -1.3e+35)
                		tmp = Float64(Float64(-1.0 / sin(B)) * Float64(Float64(Float64(1.0 + t_0) / F) * F));
                	elseif (F <= -8.2e-259)
                		tmp = Float64(t_1 + Float64(t_2 / Float64(sin(B) / F)));
                	elseif (F <= 7.8e-122)
                		tmp = Float64(Float64(-x) / tan(B));
                	elseif (F <= 4.5e-15)
                		tmp = Float64(t_1 + Float64(Float64(1.0 / sin(B)) * Float64(t_2 * F)));
                	else
                		tmp = Float64(Float64(1.0 - t_0) / sin(B));
                	end
                	return tmp
                end
                
                function tmp_2 = code(F, B, x)
                	t_0 = cos(B) * x;
                	t_1 = -(x / B);
                	t_2 = ((x + x) - (-2.0 - (F * F))) ^ -0.5;
                	tmp = 0.0;
                	if (F <= -1.3e+35)
                		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
                	elseif (F <= -8.2e-259)
                		tmp = t_1 + (t_2 / (sin(B) / F));
                	elseif (F <= 7.8e-122)
                		tmp = -x / tan(B);
                	elseif (F <= 4.5e-15)
                		tmp = t_1 + ((1.0 / sin(B)) * (t_2 * F));
                	else
                		tmp = (1.0 - t_0) / sin(B);
                	end
                	tmp_2 = tmp;
                end
                
                code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$2 = N[Power[N[(N[(x + x), $MachinePrecision] - N[(-2 - N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision]}, If[LessEqual[F, -130000000000000003301073569777188864], N[(N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1 + t$95$0), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512], N[(t$95$1 + N[(t$95$2 / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 713053462628379/158456325028528675187087900672], N[(t$95$1 + N[(N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]]
                
                \begin{array}{l}
                t_0 := \cos B \cdot x\\
                t_1 := -\frac{x}{B}\\
                t_2 := {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}\\
                \mathbf{if}\;F \leq -130000000000000003301073569777188864:\\
                \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\
                
                \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\
                \;\;\;\;t\_1 + \frac{t\_2}{\frac{\sin B}{F}}\\
                
                \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\
                \;\;\;\;\frac{-x}{\tan B}\\
                
                \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\
                \;\;\;\;t\_1 + \frac{1}{\sin B} \cdot \left(t\_2 \cdot F\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{1 - t\_0}{\sin B}\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 5 regimes
                2. if F < -1.3e35

                  1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                  5. Step-by-step derivation
                    1. lower-*.f64N/A

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

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

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

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

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

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

                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                    8. lower-/.f6451.4%

                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                  6. Applied rewrites51.4%

                    \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                  7. Applied rewrites51.4%

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

                  if -1.3e35 < F < -8.1999999999999996e-259

                  1. Initial program 76.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. Taylor expanded in B around 0

                    \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  3. Step-by-step derivation
                    1. lower-/.f6449.2%

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

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

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

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

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

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

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

                      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\frac{\sin B}{F}}} \]
                    7. lower-/.f6450.1%

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

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

                  if -8.1999999999999996e-259 < F < 7.7999999999999998e-122

                  1. Initial program 76.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. Taylor expanded in F around 0

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

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

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

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

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    5. lower-sin.f6455.8%

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  4. Applied rewrites55.8%

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

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

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

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

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

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

                      \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                    7. div-flip-revN/A

                      \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                    8. lift-sin.f64N/A

                      \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                    9. lift-cos.f64N/A

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

                      \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    11. lift-tan.f64N/A

                      \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    12. lift-/.f64N/A

                      \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    13. *-commutativeN/A

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

                      \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                    15. *-lft-identityN/A

                      \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                    16. *-commutativeN/A

                      \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                  6. Applied rewrites55.9%

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

                  if 7.7999999999999998e-122 < F < 4.4999999999999998e-15

                  1. Initial program 76.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. Taylor expanded in B around 0

                    \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  3. Step-by-step derivation
                    1. lower-/.f6449.2%

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

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

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

                  if 4.4999999999999998e-15 < F

                  1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 11: 87.0% accurate, 1.3× speedup?

                  \[\begin{array}{l} t_0 := \cos B \cdot x\\ t_1 := {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}\\ \mathbf{if}\;F \leq -86000000000000002621014052368016515123921215154871214834341745017896304640:\\ \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\ \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\ \;\;\;\;\frac{t\_1}{\sin B} \cdot F - \frac{x}{B}\\ \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sin B} \cdot \left(t\_1 \cdot F\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \]
                  (FPCore (F B x)
                    :precision binary64
                    (let* ((t_0 (* (cos B) x))
                         (t_1 (pow (- (+ x x) (- -2 (* F F))) -1/2)))
                    (if (<=
                         F
                         -86000000000000002621014052368016515123921215154871214834341745017896304640)
                      (* (/ -1 (sin B)) (* (/ (+ 1 t_0) F) F))
                      (if (<=
                           F
                           -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512)
                        (- (* (/ t_1 (sin B)) F) (/ x B))
                        (if (<=
                             F
                             7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968)
                          (/ (- x) (tan B))
                          (if (<= F 713053462628379/158456325028528675187087900672)
                            (+ (- (/ x B)) (* (/ 1 (sin B)) (* t_1 F)))
                            (/ (- 1 t_0) (sin B))))))))
                  double code(double F, double B, double x) {
                  	double t_0 = cos(B) * x;
                  	double t_1 = pow(((x + x) - (-2.0 - (F * F))), -0.5);
                  	double tmp;
                  	if (F <= -8.6e+73) {
                  		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
                  	} else if (F <= -8.2e-259) {
                  		tmp = ((t_1 / sin(B)) * F) - (x / B);
                  	} else if (F <= 7.8e-122) {
                  		tmp = -x / tan(B);
                  	} else if (F <= 4.5e-15) {
                  		tmp = -(x / B) + ((1.0 / sin(B)) * (t_1 * F));
                  	} else {
                  		tmp = (1.0 - t_0) / sin(B);
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(f, b, x)
                  use fmin_fmax_functions
                      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 = cos(b) * x
                      t_1 = ((x + x) - ((-2.0d0) - (f * f))) ** (-0.5d0)
                      if (f <= (-8.6d+73)) then
                          tmp = ((-1.0d0) / sin(b)) * (((1.0d0 + t_0) / f) * f)
                      else if (f <= (-8.2d-259)) then
                          tmp = ((t_1 / sin(b)) * f) - (x / b)
                      else if (f <= 7.8d-122) then
                          tmp = -x / tan(b)
                      else if (f <= 4.5d-15) then
                          tmp = -(x / b) + ((1.0d0 / sin(b)) * (t_1 * f))
                      else
                          tmp = (1.0d0 - t_0) / sin(b)
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double F, double B, double x) {
                  	double t_0 = Math.cos(B) * x;
                  	double t_1 = Math.pow(((x + x) - (-2.0 - (F * F))), -0.5);
                  	double tmp;
                  	if (F <= -8.6e+73) {
                  		tmp = (-1.0 / Math.sin(B)) * (((1.0 + t_0) / F) * F);
                  	} else if (F <= -8.2e-259) {
                  		tmp = ((t_1 / Math.sin(B)) * F) - (x / B);
                  	} else if (F <= 7.8e-122) {
                  		tmp = -x / Math.tan(B);
                  	} else if (F <= 4.5e-15) {
                  		tmp = -(x / B) + ((1.0 / Math.sin(B)) * (t_1 * F));
                  	} else {
                  		tmp = (1.0 - t_0) / Math.sin(B);
                  	}
                  	return tmp;
                  }
                  
                  def code(F, B, x):
                  	t_0 = math.cos(B) * x
                  	t_1 = math.pow(((x + x) - (-2.0 - (F * F))), -0.5)
                  	tmp = 0
                  	if F <= -8.6e+73:
                  		tmp = (-1.0 / math.sin(B)) * (((1.0 + t_0) / F) * F)
                  	elif F <= -8.2e-259:
                  		tmp = ((t_1 / math.sin(B)) * F) - (x / B)
                  	elif F <= 7.8e-122:
                  		tmp = -x / math.tan(B)
                  	elif F <= 4.5e-15:
                  		tmp = -(x / B) + ((1.0 / math.sin(B)) * (t_1 * F))
                  	else:
                  		tmp = (1.0 - t_0) / math.sin(B)
                  	return tmp
                  
                  function code(F, B, x)
                  	t_0 = Float64(cos(B) * x)
                  	t_1 = Float64(Float64(x + x) - Float64(-2.0 - Float64(F * F))) ^ -0.5
                  	tmp = 0.0
                  	if (F <= -8.6e+73)
                  		tmp = Float64(Float64(-1.0 / sin(B)) * Float64(Float64(Float64(1.0 + t_0) / F) * F));
                  	elseif (F <= -8.2e-259)
                  		tmp = Float64(Float64(Float64(t_1 / sin(B)) * F) - Float64(x / B));
                  	elseif (F <= 7.8e-122)
                  		tmp = Float64(Float64(-x) / tan(B));
                  	elseif (F <= 4.5e-15)
                  		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(1.0 / sin(B)) * Float64(t_1 * F)));
                  	else
                  		tmp = Float64(Float64(1.0 - t_0) / sin(B));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(F, B, x)
                  	t_0 = cos(B) * x;
                  	t_1 = ((x + x) - (-2.0 - (F * F))) ^ -0.5;
                  	tmp = 0.0;
                  	if (F <= -8.6e+73)
                  		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
                  	elseif (F <= -8.2e-259)
                  		tmp = ((t_1 / sin(B)) * F) - (x / B);
                  	elseif (F <= 7.8e-122)
                  		tmp = -x / tan(B);
                  	elseif (F <= 4.5e-15)
                  		tmp = -(x / B) + ((1.0 / sin(B)) * (t_1 * F));
                  	else
                  		tmp = (1.0 - t_0) / sin(B);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(x + x), $MachinePrecision] - N[(-2 - N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision]}, If[LessEqual[F, -86000000000000002621014052368016515123921215154871214834341745017896304640], N[(N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1 + t$95$0), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512], N[(N[(N[(t$95$1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 713053462628379/158456325028528675187087900672], N[((-N[(x / B), $MachinePrecision]) + N[(N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
                  
                  \begin{array}{l}
                  t_0 := \cos B \cdot x\\
                  t_1 := {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}\\
                  \mathbf{if}\;F \leq -86000000000000002621014052368016515123921215154871214834341745017896304640:\\
                  \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\
                  
                  \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\
                  \;\;\;\;\frac{t\_1}{\sin B} \cdot F - \frac{x}{B}\\
                  
                  \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\
                  \;\;\;\;\frac{-x}{\tan B}\\
                  
                  \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\
                  \;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sin B} \cdot \left(t\_1 \cdot F\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1 - t\_0}{\sin B}\\
                  
                  
                  \end{array}
                  
                  Derivation
                  1. Split input into 5 regimes
                  2. if F < -8.6000000000000003e73

                    1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                    5. Step-by-step derivation
                      1. lower-*.f64N/A

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

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

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

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

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

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

                        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                      8. lower-/.f6451.4%

                        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                    6. Applied rewrites51.4%

                      \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                    7. Applied rewrites51.4%

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

                    if -8.6000000000000003e73 < F < -8.1999999999999996e-259

                    1. Initial program 76.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. Taylor expanded in B around 0

                      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    3. Step-by-step derivation
                      1. lower-/.f6449.2%

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

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

                        \[\leadsto \color{blue}{\left(-\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)}} \]
                      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B}} \cdot F - \frac{x}{B} \]
                      6. lift-*.f6457.3%

                        \[\leadsto \color{blue}{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F} - \frac{x}{B} \]
                    8. Applied rewrites57.3%

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

                    if -8.1999999999999996e-259 < F < 7.7999999999999998e-122

                    1. Initial program 76.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. Taylor expanded in F around 0

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

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

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

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

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                      5. lower-sin.f6455.8%

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    4. Applied rewrites55.8%

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

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

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

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

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

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

                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                      7. div-flip-revN/A

                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                      8. lift-sin.f64N/A

                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                      9. lift-cos.f64N/A

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

                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      11. lift-tan.f64N/A

                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      12. lift-/.f64N/A

                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      13. *-commutativeN/A

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

                        \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                      15. *-lft-identityN/A

                        \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                      16. *-commutativeN/A

                        \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                    6. Applied rewrites55.9%

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

                    if 7.7999999999999998e-122 < F < 4.4999999999999998e-15

                    1. Initial program 76.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. Taylor expanded in B around 0

                      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    3. Step-by-step derivation
                      1. lower-/.f6449.2%

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

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

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

                    if 4.4999999999999998e-15 < F

                    1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 12: 86.9% accurate, 1.3× speedup?

                    \[\begin{array}{l} t_0 := \cos B \cdot x\\ t_1 := {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}\\ \mathbf{if}\;F \leq -86000000000000002621014052368016515123921215154871214834341745017896304640:\\ \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\ \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\ \;\;\;\;\frac{t\_1}{\sin B} \cdot F - \frac{x}{B}\\ \mathbf{elif}\;F \leq \frac{5470679174164527}{14396524142538228424993723224595141948383030778566133225922417832357880258148761185020930195532450742879746914027266864394266451377581759004827248578768524336431104}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\ \;\;\;\;t\_1 \cdot \left(\frac{1}{\sin B} \cdot F\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \]
                    (FPCore (F B x)
                      :precision binary64
                      (let* ((t_0 (* (cos B) x))
                           (t_1 (pow (- (+ x x) (- -2 (* F F))) -1/2)))
                      (if (<=
                           F
                           -86000000000000002621014052368016515123921215154871214834341745017896304640)
                        (* (/ -1 (sin B)) (* (/ (+ 1 t_0) F) F))
                        (if (<=
                             F
                             -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512)
                          (- (* (/ t_1 (sin B)) F) (/ x B))
                          (if (<=
                               F
                               5470679174164527/14396524142538228424993723224595141948383030778566133225922417832357880258148761185020930195532450742879746914027266864394266451377581759004827248578768524336431104)
                            (/ (- x) (tan B))
                            (if (<= F 713053462628379/158456325028528675187087900672)
                              (- (* t_1 (* (/ 1 (sin B)) F)) (/ x B))
                              (/ (- 1 t_0) (sin B))))))))
                    double code(double F, double B, double x) {
                    	double t_0 = cos(B) * x;
                    	double t_1 = pow(((x + x) - (-2.0 - (F * F))), -0.5);
                    	double tmp;
                    	if (F <= -8.6e+73) {
                    		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
                    	} else if (F <= -8.2e-259) {
                    		tmp = ((t_1 / sin(B)) * F) - (x / B);
                    	} else if (F <= 3.8e-148) {
                    		tmp = -x / tan(B);
                    	} else if (F <= 4.5e-15) {
                    		tmp = (t_1 * ((1.0 / sin(B)) * F)) - (x / B);
                    	} else {
                    		tmp = (1.0 - t_0) / sin(B);
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(f, b, x)
                    use fmin_fmax_functions
                        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 = cos(b) * x
                        t_1 = ((x + x) - ((-2.0d0) - (f * f))) ** (-0.5d0)
                        if (f <= (-8.6d+73)) then
                            tmp = ((-1.0d0) / sin(b)) * (((1.0d0 + t_0) / f) * f)
                        else if (f <= (-8.2d-259)) then
                            tmp = ((t_1 / sin(b)) * f) - (x / b)
                        else if (f <= 3.8d-148) then
                            tmp = -x / tan(b)
                        else if (f <= 4.5d-15) then
                            tmp = (t_1 * ((1.0d0 / sin(b)) * f)) - (x / b)
                        else
                            tmp = (1.0d0 - t_0) / sin(b)
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double F, double B, double x) {
                    	double t_0 = Math.cos(B) * x;
                    	double t_1 = Math.pow(((x + x) - (-2.0 - (F * F))), -0.5);
                    	double tmp;
                    	if (F <= -8.6e+73) {
                    		tmp = (-1.0 / Math.sin(B)) * (((1.0 + t_0) / F) * F);
                    	} else if (F <= -8.2e-259) {
                    		tmp = ((t_1 / Math.sin(B)) * F) - (x / B);
                    	} else if (F <= 3.8e-148) {
                    		tmp = -x / Math.tan(B);
                    	} else if (F <= 4.5e-15) {
                    		tmp = (t_1 * ((1.0 / Math.sin(B)) * F)) - (x / B);
                    	} else {
                    		tmp = (1.0 - t_0) / Math.sin(B);
                    	}
                    	return tmp;
                    }
                    
                    def code(F, B, x):
                    	t_0 = math.cos(B) * x
                    	t_1 = math.pow(((x + x) - (-2.0 - (F * F))), -0.5)
                    	tmp = 0
                    	if F <= -8.6e+73:
                    		tmp = (-1.0 / math.sin(B)) * (((1.0 + t_0) / F) * F)
                    	elif F <= -8.2e-259:
                    		tmp = ((t_1 / math.sin(B)) * F) - (x / B)
                    	elif F <= 3.8e-148:
                    		tmp = -x / math.tan(B)
                    	elif F <= 4.5e-15:
                    		tmp = (t_1 * ((1.0 / math.sin(B)) * F)) - (x / B)
                    	else:
                    		tmp = (1.0 - t_0) / math.sin(B)
                    	return tmp
                    
                    function code(F, B, x)
                    	t_0 = Float64(cos(B) * x)
                    	t_1 = Float64(Float64(x + x) - Float64(-2.0 - Float64(F * F))) ^ -0.5
                    	tmp = 0.0
                    	if (F <= -8.6e+73)
                    		tmp = Float64(Float64(-1.0 / sin(B)) * Float64(Float64(Float64(1.0 + t_0) / F) * F));
                    	elseif (F <= -8.2e-259)
                    		tmp = Float64(Float64(Float64(t_1 / sin(B)) * F) - Float64(x / B));
                    	elseif (F <= 3.8e-148)
                    		tmp = Float64(Float64(-x) / tan(B));
                    	elseif (F <= 4.5e-15)
                    		tmp = Float64(Float64(t_1 * Float64(Float64(1.0 / sin(B)) * F)) - Float64(x / B));
                    	else
                    		tmp = Float64(Float64(1.0 - t_0) / sin(B));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(F, B, x)
                    	t_0 = cos(B) * x;
                    	t_1 = ((x + x) - (-2.0 - (F * F))) ^ -0.5;
                    	tmp = 0.0;
                    	if (F <= -8.6e+73)
                    		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
                    	elseif (F <= -8.2e-259)
                    		tmp = ((t_1 / sin(B)) * F) - (x / B);
                    	elseif (F <= 3.8e-148)
                    		tmp = -x / tan(B);
                    	elseif (F <= 4.5e-15)
                    		tmp = (t_1 * ((1.0 / sin(B)) * F)) - (x / B);
                    	else
                    		tmp = (1.0 - t_0) / sin(B);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(x + x), $MachinePrecision] - N[(-2 - N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision]}, If[LessEqual[F, -86000000000000002621014052368016515123921215154871214834341745017896304640], N[(N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1 + t$95$0), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512], N[(N[(N[(t$95$1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5470679174164527/14396524142538228424993723224595141948383030778566133225922417832357880258148761185020930195532450742879746914027266864394266451377581759004827248578768524336431104], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 713053462628379/158456325028528675187087900672], N[(N[(t$95$1 * N[(N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
                    
                    \begin{array}{l}
                    t_0 := \cos B \cdot x\\
                    t_1 := {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}\\
                    \mathbf{if}\;F \leq -86000000000000002621014052368016515123921215154871214834341745017896304640:\\
                    \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\
                    
                    \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\
                    \;\;\;\;\frac{t\_1}{\sin B} \cdot F - \frac{x}{B}\\
                    
                    \mathbf{elif}\;F \leq \frac{5470679174164527}{14396524142538228424993723224595141948383030778566133225922417832357880258148761185020930195532450742879746914027266864394266451377581759004827248578768524336431104}:\\
                    \;\;\;\;\frac{-x}{\tan B}\\
                    
                    \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\
                    \;\;\;\;t\_1 \cdot \left(\frac{1}{\sin B} \cdot F\right) - \frac{x}{B}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{1 - t\_0}{\sin B}\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 5 regimes
                    2. if F < -8.6000000000000003e73

                      1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                      5. Step-by-step derivation
                        1. lower-*.f64N/A

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

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

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

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

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

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

                          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                        8. lower-/.f6451.4%

                          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                      6. Applied rewrites51.4%

                        \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                      7. Applied rewrites51.4%

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

                      if -8.6000000000000003e73 < F < -8.1999999999999996e-259

                      1. Initial program 76.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. Taylor expanded in B around 0

                        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                      3. Step-by-step derivation
                        1. lower-/.f6449.2%

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

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

                          \[\leadsto \color{blue}{\left(-\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)}} \]
                        2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B}} \cdot F - \frac{x}{B} \]
                        6. lift-*.f6457.3%

                          \[\leadsto \color{blue}{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F} - \frac{x}{B} \]
                      8. Applied rewrites57.3%

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

                      if -8.1999999999999996e-259 < F < 3.8000000000000001e-148

                      1. Initial program 76.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. Taylor expanded in F around 0

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

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

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

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

                          \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                        5. lower-sin.f6455.8%

                          \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                      4. Applied rewrites55.8%

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

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

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

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

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

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

                          \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                        7. div-flip-revN/A

                          \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                        8. lift-sin.f64N/A

                          \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                        9. lift-cos.f64N/A

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

                          \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        11. lift-tan.f64N/A

                          \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        12. lift-/.f64N/A

                          \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        13. *-commutativeN/A

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

                          \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                        15. *-lft-identityN/A

                          \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                        16. *-commutativeN/A

                          \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                      6. Applied rewrites55.9%

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

                      if 3.8000000000000001e-148 < F < 4.4999999999999998e-15

                      1. Initial program 76.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. Taylor expanded in B around 0

                        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                      3. Step-by-step derivation
                        1. lower-/.f6449.2%

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

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

                          \[\leadsto \color{blue}{\left(-\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)}} \]
                        2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                      if 4.4999999999999998e-15 < F

                      1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 13: 86.7% accurate, 1.4× speedup?

                      \[\begin{array}{l} t_0 := \cos B \cdot x\\ \mathbf{if}\;F \leq -86000000000000002621014052368016515123921215154871214834341745017896304640:\\ \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\ \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\ \;\;\;\;\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - \frac{x}{B}\\ \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \]
                      (FPCore (F B x)
                        :precision binary64
                        (let* ((t_0 (* (cos B) x)))
                        (if (<=
                             F
                             -86000000000000002621014052368016515123921215154871214834341745017896304640)
                          (* (/ -1 (sin B)) (* (/ (+ 1 t_0) F) F))
                          (if (<=
                               F
                               -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512)
                            (-
                             (* (/ (pow (- (+ x x) (- -2 (* F F))) -1/2) (sin B)) F)
                             (/ x B))
                            (if (<=
                                 F
                                 7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968)
                              (/ (- x) (tan B))
                              (if (<= F 713053462628379/158456325028528675187087900672)
                                (+ (- (/ x B)) (/ (* F (pow (+ 2 (* 2 x)) -1/2)) (sin B)))
                                (/ (- 1 t_0) (sin B))))))))
                      double code(double F, double B, double x) {
                      	double t_0 = cos(B) * x;
                      	double tmp;
                      	if (F <= -8.6e+73) {
                      		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
                      	} else if (F <= -8.2e-259) {
                      		tmp = ((pow(((x + x) - (-2.0 - (F * F))), -0.5) / sin(B)) * F) - (x / B);
                      	} else if (F <= 7.8e-122) {
                      		tmp = -x / tan(B);
                      	} else if (F <= 4.5e-15) {
                      		tmp = -(x / B) + ((F * pow((2.0 + (2.0 * x)), -0.5)) / sin(B));
                      	} else {
                      		tmp = (1.0 - t_0) / sin(B);
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(f, b, x)
                      use fmin_fmax_functions
                          real(8), intent (in) :: f
                          real(8), intent (in) :: b
                          real(8), intent (in) :: x
                          real(8) :: t_0
                          real(8) :: tmp
                          t_0 = cos(b) * x
                          if (f <= (-8.6d+73)) then
                              tmp = ((-1.0d0) / sin(b)) * (((1.0d0 + t_0) / f) * f)
                          else if (f <= (-8.2d-259)) then
                              tmp = (((((x + x) - ((-2.0d0) - (f * f))) ** (-0.5d0)) / sin(b)) * f) - (x / b)
                          else if (f <= 7.8d-122) then
                              tmp = -x / tan(b)
                          else if (f <= 4.5d-15) then
                              tmp = -(x / b) + ((f * ((2.0d0 + (2.0d0 * x)) ** (-0.5d0))) / sin(b))
                          else
                              tmp = (1.0d0 - t_0) / sin(b)
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double F, double B, double x) {
                      	double t_0 = Math.cos(B) * x;
                      	double tmp;
                      	if (F <= -8.6e+73) {
                      		tmp = (-1.0 / Math.sin(B)) * (((1.0 + t_0) / F) * F);
                      	} else if (F <= -8.2e-259) {
                      		tmp = ((Math.pow(((x + x) - (-2.0 - (F * F))), -0.5) / Math.sin(B)) * F) - (x / B);
                      	} else if (F <= 7.8e-122) {
                      		tmp = -x / Math.tan(B);
                      	} else if (F <= 4.5e-15) {
                      		tmp = -(x / B) + ((F * Math.pow((2.0 + (2.0 * x)), -0.5)) / Math.sin(B));
                      	} else {
                      		tmp = (1.0 - t_0) / Math.sin(B);
                      	}
                      	return tmp;
                      }
                      
                      def code(F, B, x):
                      	t_0 = math.cos(B) * x
                      	tmp = 0
                      	if F <= -8.6e+73:
                      		tmp = (-1.0 / math.sin(B)) * (((1.0 + t_0) / F) * F)
                      	elif F <= -8.2e-259:
                      		tmp = ((math.pow(((x + x) - (-2.0 - (F * F))), -0.5) / math.sin(B)) * F) - (x / B)
                      	elif F <= 7.8e-122:
                      		tmp = -x / math.tan(B)
                      	elif F <= 4.5e-15:
                      		tmp = -(x / B) + ((F * math.pow((2.0 + (2.0 * x)), -0.5)) / math.sin(B))
                      	else:
                      		tmp = (1.0 - t_0) / math.sin(B)
                      	return tmp
                      
                      function code(F, B, x)
                      	t_0 = Float64(cos(B) * x)
                      	tmp = 0.0
                      	if (F <= -8.6e+73)
                      		tmp = Float64(Float64(-1.0 / sin(B)) * Float64(Float64(Float64(1.0 + t_0) / F) * F));
                      	elseif (F <= -8.2e-259)
                      		tmp = Float64(Float64(Float64((Float64(Float64(x + x) - Float64(-2.0 - Float64(F * F))) ^ -0.5) / sin(B)) * F) - Float64(x / B));
                      	elseif (F <= 7.8e-122)
                      		tmp = Float64(Float64(-x) / tan(B));
                      	elseif (F <= 4.5e-15)
                      		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5)) / sin(B)));
                      	else
                      		tmp = Float64(Float64(1.0 - t_0) / sin(B));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(F, B, x)
                      	t_0 = cos(B) * x;
                      	tmp = 0.0;
                      	if (F <= -8.6e+73)
                      		tmp = (-1.0 / sin(B)) * (((1.0 + t_0) / F) * F);
                      	elseif (F <= -8.2e-259)
                      		tmp = (((((x + x) - (-2.0 - (F * F))) ^ -0.5) / sin(B)) * F) - (x / B);
                      	elseif (F <= 7.8e-122)
                      		tmp = -x / tan(B);
                      	elseif (F <= 4.5e-15)
                      		tmp = -(x / B) + ((F * ((2.0 + (2.0 * x)) ^ -0.5)) / sin(B));
                      	else
                      		tmp = (1.0 - t_0) / sin(B);
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -86000000000000002621014052368016515123921215154871214834341745017896304640], N[(N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1 + t$95$0), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512], N[(N[(N[(N[Power[N[(N[(x + x), $MachinePrecision] - N[(-2 - N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 713053462628379/158456325028528675187087900672], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2 + N[(2 * x), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
                      
                      \begin{array}{l}
                      t_0 := \cos B \cdot x\\
                      \mathbf{if}\;F \leq -86000000000000002621014052368016515123921215154871214834341745017896304640:\\
                      \;\;\;\;\frac{-1}{\sin B} \cdot \left(\frac{1 + t\_0}{F} \cdot F\right)\\
                      
                      \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\
                      \;\;\;\;\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - \frac{x}{B}\\
                      
                      \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\
                      \;\;\;\;\frac{-x}{\tan B}\\
                      
                      \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\
                      \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}}{\sin B}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{1 - t\_0}{\sin B}\\
                      
                      
                      \end{array}
                      
                      Derivation
                      1. Split input into 5 regimes
                      2. if F < -8.6000000000000003e73

                        1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                        5. Step-by-step derivation
                          1. lower-*.f64N/A

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

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

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

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

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

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

                            \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                          8. lower-/.f6451.4%

                            \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                        6. Applied rewrites51.4%

                          \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                        7. Applied rewrites51.4%

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

                        if -8.6000000000000003e73 < F < -8.1999999999999996e-259

                        1. Initial program 76.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. Taylor expanded in B around 0

                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        3. Step-by-step derivation
                          1. lower-/.f6449.2%

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

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

                            \[\leadsto \color{blue}{\left(-\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)}} \]
                          2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B}} \cdot F - \frac{x}{B} \]
                          6. lift-*.f6457.3%

                            \[\leadsto \color{blue}{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F} - \frac{x}{B} \]
                        8. Applied rewrites57.3%

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

                        if -8.1999999999999996e-259 < F < 7.7999999999999998e-122

                        1. Initial program 76.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. Taylor expanded in F around 0

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

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

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

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

                            \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                          5. lower-sin.f6455.8%

                            \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                        4. Applied rewrites55.8%

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

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

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

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

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

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

                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                          7. div-flip-revN/A

                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                          8. lift-sin.f64N/A

                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                          9. lift-cos.f64N/A

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

                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          11. lift-tan.f64N/A

                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          12. lift-/.f64N/A

                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          13. *-commutativeN/A

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

                            \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                          15. *-lft-identityN/A

                            \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                          16. *-commutativeN/A

                            \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                        6. Applied rewrites55.9%

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

                        if 7.7999999999999998e-122 < F < 4.4999999999999998e-15

                        1. Initial program 76.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. Taylor expanded in B around 0

                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        3. Step-by-step derivation
                          1. lower-/.f6449.2%

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}}{\sin B} \]
                          10. lower-sin.f6435.7%

                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}}{\sin B} \]
                        7. Applied rewrites35.7%

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

                        if 4.4999999999999998e-15 < F

                        1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 14: 86.6% accurate, 1.4× speedup?

                        \[\begin{array}{l} t_0 := \left(-\frac{x}{B}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}}{\sin B}\\ \mathbf{if}\;F \leq \frac{-6284457040522883}{1461501637330902918203684832716283019655932542976}:\\ \;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
                        (FPCore (F B x)
                          :precision binary64
                          (let* ((t_0
                                (+ (- (/ x B)) (/ (* F (pow (+ 2 (* 2 x)) -1/2)) (sin B)))))
                          (if (<=
                               F
                               -6284457040522883/1461501637330902918203684832716283019655932542976)
                            (/ (+ 1 (* x (cos B))) (- (sin B)))
                            (if (<=
                                 F
                                 -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512)
                              t_0
                              (if (<=
                                   F
                                   7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968)
                                (/ (- x) (tan B))
                                (if (<= F 713053462628379/158456325028528675187087900672)
                                  t_0
                                  (/ (- 1 (* (cos B) x)) (sin B))))))))
                        double code(double F, double B, double x) {
                        	double t_0 = -(x / B) + ((F * pow((2.0 + (2.0 * x)), -0.5)) / sin(B));
                        	double tmp;
                        	if (F <= -4.3e-33) {
                        		tmp = (1.0 + (x * cos(B))) / -sin(B);
                        	} else if (F <= -8.2e-259) {
                        		tmp = t_0;
                        	} else if (F <= 7.8e-122) {
                        		tmp = -x / tan(B);
                        	} else if (F <= 4.5e-15) {
                        		tmp = t_0;
                        	} else {
                        		tmp = (1.0 - (cos(B) * x)) / sin(B);
                        	}
                        	return tmp;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(f, b, x)
                        use fmin_fmax_functions
                            real(8), intent (in) :: f
                            real(8), intent (in) :: b
                            real(8), intent (in) :: x
                            real(8) :: t_0
                            real(8) :: tmp
                            t_0 = -(x / b) + ((f * ((2.0d0 + (2.0d0 * x)) ** (-0.5d0))) / sin(b))
                            if (f <= (-4.3d-33)) then
                                tmp = (1.0d0 + (x * cos(b))) / -sin(b)
                            else if (f <= (-8.2d-259)) then
                                tmp = t_0
                            else if (f <= 7.8d-122) then
                                tmp = -x / tan(b)
                            else if (f <= 4.5d-15) then
                                tmp = t_0
                            else
                                tmp = (1.0d0 - (cos(b) * x)) / sin(b)
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double F, double B, double x) {
                        	double t_0 = -(x / B) + ((F * Math.pow((2.0 + (2.0 * x)), -0.5)) / Math.sin(B));
                        	double tmp;
                        	if (F <= -4.3e-33) {
                        		tmp = (1.0 + (x * Math.cos(B))) / -Math.sin(B);
                        	} else if (F <= -8.2e-259) {
                        		tmp = t_0;
                        	} else if (F <= 7.8e-122) {
                        		tmp = -x / Math.tan(B);
                        	} else if (F <= 4.5e-15) {
                        		tmp = t_0;
                        	} else {
                        		tmp = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
                        	}
                        	return tmp;
                        }
                        
                        def code(F, B, x):
                        	t_0 = -(x / B) + ((F * math.pow((2.0 + (2.0 * x)), -0.5)) / math.sin(B))
                        	tmp = 0
                        	if F <= -4.3e-33:
                        		tmp = (1.0 + (x * math.cos(B))) / -math.sin(B)
                        	elif F <= -8.2e-259:
                        		tmp = t_0
                        	elif F <= 7.8e-122:
                        		tmp = -x / math.tan(B)
                        	elif F <= 4.5e-15:
                        		tmp = t_0
                        	else:
                        		tmp = (1.0 - (math.cos(B) * x)) / math.sin(B)
                        	return tmp
                        
                        function code(F, B, x)
                        	t_0 = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5)) / sin(B)))
                        	tmp = 0.0
                        	if (F <= -4.3e-33)
                        		tmp = Float64(Float64(1.0 + Float64(x * cos(B))) / Float64(-sin(B)));
                        	elseif (F <= -8.2e-259)
                        		tmp = t_0;
                        	elseif (F <= 7.8e-122)
                        		tmp = Float64(Float64(-x) / tan(B));
                        	elseif (F <= 4.5e-15)
                        		tmp = t_0;
                        	else
                        		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(F, B, x)
                        	t_0 = -(x / B) + ((F * ((2.0 + (2.0 * x)) ^ -0.5)) / sin(B));
                        	tmp = 0.0;
                        	if (F <= -4.3e-33)
                        		tmp = (1.0 + (x * cos(B))) / -sin(B);
                        	elseif (F <= -8.2e-259)
                        		tmp = t_0;
                        	elseif (F <= 7.8e-122)
                        		tmp = -x / tan(B);
                        	elseif (F <= 4.5e-15)
                        		tmp = t_0;
                        	else
                        		tmp = (1.0 - (cos(B) * x)) / sin(B);
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2 + N[(2 * x), $MachinePrecision]), $MachinePrecision], -1/2], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6284457040522883/1461501637330902918203684832716283019655932542976], N[(N[(1 + N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512], t$95$0, If[LessEqual[F, 7256757823367339/93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 713053462628379/158456325028528675187087900672], t$95$0, N[(N[(1 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
                        
                        \begin{array}{l}
                        t_0 := \left(-\frac{x}{B}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}}{\sin B}\\
                        \mathbf{if}\;F \leq \frac{-6284457040522883}{1461501637330902918203684832716283019655932542976}:\\
                        \;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\
                        
                        \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;F \leq \frac{7256757823367339}{93035356709837681990313447409664580397266094167976711716030745495121828878514934185752454491361736391777602765602070775492429008462675968}:\\
                        \;\;\;\;\frac{-x}{\tan B}\\
                        
                        \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
                        
                        
                        \end{array}
                        
                        Derivation
                        1. Split input into 4 regimes
                        2. if F < -4.3000000000000003e-33

                          1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                          5. Step-by-step derivation
                            1. lower-*.f64N/A

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

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

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

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

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

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

                              \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                            8. lower-/.f6451.4%

                              \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                          6. Applied rewrites51.4%

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

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

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

                              \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
                            3. lower-cos.f6455.8%

                              \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
                          9. Applied rewrites55.8%

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

                          if -4.3000000000000003e-33 < F < -8.1999999999999996e-259 or 7.7999999999999998e-122 < F < 4.4999999999999998e-15

                          1. Initial program 76.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. Taylor expanded in B around 0

                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                          3. Step-by-step derivation
                            1. lower-/.f6449.2%

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}}{\sin B} \]
                            10. lower-sin.f6435.7%

                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}}{\sin B} \]
                          7. Applied rewrites35.7%

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

                          if -8.1999999999999996e-259 < F < 7.7999999999999998e-122

                          1. Initial program 76.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. Taylor expanded in F around 0

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

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

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

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

                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                            5. lower-sin.f6455.8%

                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                          4. Applied rewrites55.8%

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

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

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

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

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

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

                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                            7. div-flip-revN/A

                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                            8. lift-sin.f64N/A

                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                            9. lift-cos.f64N/A

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

                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            11. lift-tan.f64N/A

                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            12. lift-/.f64N/A

                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            13. *-commutativeN/A

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

                              \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                            15. *-lft-identityN/A

                              \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                            16. *-commutativeN/A

                              \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                          6. Applied rewrites55.9%

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

                          if 4.4999999999999998e-15 < F

                          1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 15: 86.6% accurate, 1.4× speedup?

                          \[\begin{array}{l} t_0 := {\left(\left(x + x\right) - -2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq \frac{-6284457040522883}{1461501637330902918203684832716283019655932542976}:\\ \;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq \frac{5470679174164527}{14396524142538228424993723224595141948383030778566133225922417832357880258148761185020930195532450742879746914027266864394266451377581759004827248578768524336431104}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
                          (FPCore (F B x)
                            :precision binary64
                            (let* ((t_0 (- (* (pow (- (+ x x) -2) -1/2) (/ F (sin B))) (/ x B))))
                            (if (<=
                                 F
                                 -6284457040522883/1461501637330902918203684832716283019655932542976)
                              (/ (+ 1 (* x (cos B))) (- (sin B)))
                              (if (<=
                                   F
                                   -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512)
                                t_0
                                (if (<=
                                     F
                                     5470679174164527/14396524142538228424993723224595141948383030778566133225922417832357880258148761185020930195532450742879746914027266864394266451377581759004827248578768524336431104)
                                  (/ (- x) (tan B))
                                  (if (<= F 713053462628379/158456325028528675187087900672)
                                    t_0
                                    (/ (- 1 (* (cos B) x)) (sin B))))))))
                          double code(double F, double B, double x) {
                          	double t_0 = (pow(((x + x) - -2.0), -0.5) * (F / sin(B))) - (x / B);
                          	double tmp;
                          	if (F <= -4.3e-33) {
                          		tmp = (1.0 + (x * cos(B))) / -sin(B);
                          	} else if (F <= -8.2e-259) {
                          		tmp = t_0;
                          	} else if (F <= 3.8e-148) {
                          		tmp = -x / tan(B);
                          	} else if (F <= 4.5e-15) {
                          		tmp = t_0;
                          	} else {
                          		tmp = (1.0 - (cos(B) * x)) / sin(B);
                          	}
                          	return tmp;
                          }
                          
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(f, b, x)
                          use fmin_fmax_functions
                              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 + x) - (-2.0d0)) ** (-0.5d0)) * (f / sin(b))) - (x / b)
                              if (f <= (-4.3d-33)) then
                                  tmp = (1.0d0 + (x * cos(b))) / -sin(b)
                              else if (f <= (-8.2d-259)) then
                                  tmp = t_0
                              else if (f <= 3.8d-148) then
                                  tmp = -x / tan(b)
                              else if (f <= 4.5d-15) then
                                  tmp = t_0
                              else
                                  tmp = (1.0d0 - (cos(b) * x)) / sin(b)
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double F, double B, double x) {
                          	double t_0 = (Math.pow(((x + x) - -2.0), -0.5) * (F / Math.sin(B))) - (x / B);
                          	double tmp;
                          	if (F <= -4.3e-33) {
                          		tmp = (1.0 + (x * Math.cos(B))) / -Math.sin(B);
                          	} else if (F <= -8.2e-259) {
                          		tmp = t_0;
                          	} else if (F <= 3.8e-148) {
                          		tmp = -x / Math.tan(B);
                          	} else if (F <= 4.5e-15) {
                          		tmp = t_0;
                          	} else {
                          		tmp = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
                          	}
                          	return tmp;
                          }
                          
                          def code(F, B, x):
                          	t_0 = (math.pow(((x + x) - -2.0), -0.5) * (F / math.sin(B))) - (x / B)
                          	tmp = 0
                          	if F <= -4.3e-33:
                          		tmp = (1.0 + (x * math.cos(B))) / -math.sin(B)
                          	elif F <= -8.2e-259:
                          		tmp = t_0
                          	elif F <= 3.8e-148:
                          		tmp = -x / math.tan(B)
                          	elif F <= 4.5e-15:
                          		tmp = t_0
                          	else:
                          		tmp = (1.0 - (math.cos(B) * x)) / math.sin(B)
                          	return tmp
                          
                          function code(F, B, x)
                          	t_0 = Float64(Float64((Float64(Float64(x + x) - -2.0) ^ -0.5) * Float64(F / sin(B))) - Float64(x / B))
                          	tmp = 0.0
                          	if (F <= -4.3e-33)
                          		tmp = Float64(Float64(1.0 + Float64(x * cos(B))) / Float64(-sin(B)));
                          	elseif (F <= -8.2e-259)
                          		tmp = t_0;
                          	elseif (F <= 3.8e-148)
                          		tmp = Float64(Float64(-x) / tan(B));
                          	elseif (F <= 4.5e-15)
                          		tmp = t_0;
                          	else
                          		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(F, B, x)
                          	t_0 = ((((x + x) - -2.0) ^ -0.5) * (F / sin(B))) - (x / B);
                          	tmp = 0.0;
                          	if (F <= -4.3e-33)
                          		tmp = (1.0 + (x * cos(B))) / -sin(B);
                          	elseif (F <= -8.2e-259)
                          		tmp = t_0;
                          	elseif (F <= 3.8e-148)
                          		tmp = -x / tan(B);
                          	elseif (F <= 4.5e-15)
                          		tmp = t_0;
                          	else
                          		tmp = (1.0 - (cos(B) * x)) / sin(B);
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Power[N[(N[(x + x), $MachinePrecision] - -2), $MachinePrecision], -1/2], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6284457040522883/1461501637330902918203684832716283019655932542976], N[(N[(1 + N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512], t$95$0, If[LessEqual[F, 5470679174164527/14396524142538228424993723224595141948383030778566133225922417832357880258148761185020930195532450742879746914027266864394266451377581759004827248578768524336431104], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 713053462628379/158456325028528675187087900672], t$95$0, N[(N[(1 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
                          
                          \begin{array}{l}
                          t_0 := {\left(\left(x + x\right) - -2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
                          \mathbf{if}\;F \leq \frac{-6284457040522883}{1461501637330902918203684832716283019655932542976}:\\
                          \;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\
                          
                          \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\
                          \;\;\;\;t\_0\\
                          
                          \mathbf{elif}\;F \leq \frac{5470679174164527}{14396524142538228424993723224595141948383030778566133225922417832357880258148761185020930195532450742879746914027266864394266451377581759004827248578768524336431104}:\\
                          \;\;\;\;\frac{-x}{\tan B}\\
                          
                          \mathbf{elif}\;F \leq \frac{713053462628379}{158456325028528675187087900672}:\\
                          \;\;\;\;t\_0\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
                          
                          
                          \end{array}
                          
                          Derivation
                          1. Split input into 4 regimes
                          2. if F < -4.3000000000000003e-33

                            1. Initial program 76.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                            5. Step-by-step derivation
                              1. lower-*.f64N/A

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

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

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

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

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

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

                                \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                              8. lower-/.f6451.4%

                                \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                            6. Applied rewrites51.4%

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

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

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

                                \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
                              3. lower-cos.f6455.8%

                                \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
                            9. Applied rewrites55.8%

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

                            if -4.3000000000000003e-33 < F < -8.1999999999999996e-259 or 3.8000000000000001e-148 < F < 4.4999999999999998e-15

                            1. Initial program 76.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. Taylor expanded in B around 0

                              \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            3. Step-by-step derivation
                              1. lower-/.f6449.2%

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

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

                                \[\leadsto \color{blue}{\left(-\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)}} \]
                              2. +-commutativeN/A

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

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

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

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

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

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

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

                              if -8.1999999999999996e-259 < F < 3.8000000000000001e-148

                              1. Initial program 76.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. Taylor expanded in F around 0

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

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

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

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

                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                5. lower-sin.f6455.8%

                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                              4. Applied rewrites55.8%

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

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

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

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                4. lift-/.f64N/A

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                5. lift-*.f64N/A

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                6. associate-/l*N/A

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                                7. div-flip-revN/A

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                8. lift-sin.f64N/A

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                9. lift-cos.f64N/A

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                10. tan-quotN/A

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                11. lift-tan.f64N/A

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                12. lift-/.f64N/A

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                13. *-commutativeN/A

                                  \[\leadsto \mathsf{neg}\left(1 \cdot \left(\frac{1}{\tan B} \cdot x\right)\right) \]
                                14. associate-*l*N/A

                                  \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                                15. *-lft-identityN/A

                                  \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                                16. *-commutativeN/A

                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                              6. Applied rewrites55.9%

                                \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                              if 4.4999999999999998e-15 < F

                              1. Initial program 76.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. lift-+.f64N/A

                                  \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                2. add-flipN/A

                                  \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right)} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}\right)\right) \]
                                4. lift-/.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right) \]
                                5. associate-*l/N/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}\right)\right) \]
                                6. distribute-neg-frac2N/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                7. sub-to-fractionN/A

                                  \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                8. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                              3. Applied rewrites85.1%

                                \[\leadsto \color{blue}{\frac{\frac{-x}{\tan B} \cdot \left(-\sin B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B}} \]
                              4. Applied rewrites85.1%

                                \[\leadsto \color{blue}{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F - \cos B \cdot x}{\sin B}} \]
                              5. Taylor expanded in F around inf

                                \[\leadsto \frac{\color{blue}{1} - \cos B \cdot x}{\sin B} \]
                              6. Step-by-step derivation
                                1. Applied rewrites56.5%

                                  \[\leadsto \frac{\color{blue}{1} - \cos B \cdot x}{\sin B} \]
                              7. Recombined 4 regimes into one program.
                              8. Add Preprocessing

                              Alternative 16: 84.7% accurate, 1.6× speedup?

                              \[\begin{array}{l} \mathbf{if}\;F \leq \frac{-1010998000018149}{3369993333393829974333376885877453834204643052817571560137951281152}:\\ \;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq \frac{5057235284857433}{3064991081731777716716694054300618367237478244367204352}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
                              (FPCore (F B x)
                                :precision binary64
                                (if (<=
                                   F
                                   -1010998000018149/3369993333393829974333376885877453834204643052817571560137951281152)
                                (/ (+ 1 (* x (cos B))) (- (sin B)))
                                (if (<=
                                     F
                                     5057235284857433/3064991081731777716716694054300618367237478244367204352)
                                  (/ (- x) (tan B))
                                  (/ (- 1 (* (cos B) x)) (sin B)))))
                              double code(double F, double B, double x) {
                              	double tmp;
                              	if (F <= -3e-52) {
                              		tmp = (1.0 + (x * cos(B))) / -sin(B);
                              	} else if (F <= 1.65e-39) {
                              		tmp = -x / tan(B);
                              	} else {
                              		tmp = (1.0 - (cos(B) * x)) / sin(B);
                              	}
                              	return tmp;
                              }
                              
                              module fmin_fmax_functions
                                  implicit none
                                  private
                                  public fmax
                                  public fmin
                              
                                  interface fmax
                                      module procedure fmax88
                                      module procedure fmax44
                                      module procedure fmax84
                                      module procedure fmax48
                                  end interface
                                  interface fmin
                                      module procedure fmin88
                                      module procedure fmin44
                                      module procedure fmin84
                                      module procedure fmin48
                                  end interface
                              contains
                                  real(8) function fmax88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmax44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmax84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmax48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmin44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmin48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                  end function
                              end module
                              
                              real(8) function code(f, b, x)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: f
                                  real(8), intent (in) :: b
                                  real(8), intent (in) :: x
                                  real(8) :: tmp
                                  if (f <= (-3d-52)) then
                                      tmp = (1.0d0 + (x * cos(b))) / -sin(b)
                                  else if (f <= 1.65d-39) then
                                      tmp = -x / tan(b)
                                  else
                                      tmp = (1.0d0 - (cos(b) * x)) / sin(b)
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double F, double B, double x) {
                              	double tmp;
                              	if (F <= -3e-52) {
                              		tmp = (1.0 + (x * Math.cos(B))) / -Math.sin(B);
                              	} else if (F <= 1.65e-39) {
                              		tmp = -x / Math.tan(B);
                              	} else {
                              		tmp = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
                              	}
                              	return tmp;
                              }
                              
                              def code(F, B, x):
                              	tmp = 0
                              	if F <= -3e-52:
                              		tmp = (1.0 + (x * math.cos(B))) / -math.sin(B)
                              	elif F <= 1.65e-39:
                              		tmp = -x / math.tan(B)
                              	else:
                              		tmp = (1.0 - (math.cos(B) * x)) / math.sin(B)
                              	return tmp
                              
                              function code(F, B, x)
                              	tmp = 0.0
                              	if (F <= -3e-52)
                              		tmp = Float64(Float64(1.0 + Float64(x * cos(B))) / Float64(-sin(B)));
                              	elseif (F <= 1.65e-39)
                              		tmp = Float64(Float64(-x) / tan(B));
                              	else
                              		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(F, B, x)
                              	tmp = 0.0;
                              	if (F <= -3e-52)
                              		tmp = (1.0 + (x * cos(B))) / -sin(B);
                              	elseif (F <= 1.65e-39)
                              		tmp = -x / tan(B);
                              	else
                              		tmp = (1.0 - (cos(B) * x)) / sin(B);
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[F_, B_, x_] := If[LessEqual[F, -1010998000018149/3369993333393829974333376885877453834204643052817571560137951281152], N[(N[(1 + N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 5057235284857433/3064991081731777716716694054300618367237478244367204352], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              \mathbf{if}\;F \leq \frac{-1010998000018149}{3369993333393829974333376885877453834204643052817571560137951281152}:\\
                              \;\;\;\;\frac{1 + x \cdot \cos B}{-\sin B}\\
                              
                              \mathbf{elif}\;F \leq \frac{5057235284857433}{3064991081731777716716694054300618367237478244367204352}:\\
                              \;\;\;\;\frac{-x}{\tan B}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
                              
                              
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if F < -3e-52

                                1. Initial program 76.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. lift-+.f64N/A

                                    \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                  2. add-flipN/A

                                    \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right)} \]
                                  3. lift-*.f64N/A

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}\right)\right) \]
                                  4. lift-/.f64N/A

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right) \]
                                  5. associate-*l/N/A

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}\right)\right) \]
                                  6. distribute-neg-frac2N/A

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                  7. sub-to-fractionN/A

                                    \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                  8. lower-/.f64N/A

                                    \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                3. Applied rewrites85.1%

                                  \[\leadsto \color{blue}{\frac{\frac{-x}{\tan B} \cdot \left(-\sin B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B}} \]
                                4. Taylor expanded in F around -inf

                                  \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                5. Step-by-step derivation
                                  1. lower-*.f64N/A

                                    \[\leadsto \frac{-1 \cdot \color{blue}{\left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                  2. lower-*.f64N/A

                                    \[\leadsto \frac{-1 \cdot \left(F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)}\right)}{-\sin B} \]
                                  3. lower--.f64N/A

                                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \color{blue}{\frac{1}{F}}\right)\right)}{-\sin B} \]
                                  4. lower-*.f64N/A

                                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{\color{blue}{1}}{F}\right)\right)}{-\sin B} \]
                                  5. lower-/.f64N/A

                                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                  6. lower-*.f64N/A

                                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                  7. lower-cos.f64N/A

                                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                  8. lower-/.f6451.4%

                                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                                6. Applied rewrites51.4%

                                  \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                7. Taylor expanded in F around -inf

                                  \[\leadsto \frac{1 + \color{blue}{x \cdot \cos B}}{-\sin B} \]
                                8. Step-by-step derivation
                                  1. lower-+.f64N/A

                                    \[\leadsto \frac{1 + x \cdot \color{blue}{\cos B}}{-\sin B} \]
                                  2. lower-*.f64N/A

                                    \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
                                  3. lower-cos.f6455.8%

                                    \[\leadsto \frac{1 + x \cdot \cos B}{-\sin B} \]
                                9. Applied rewrites55.8%

                                  \[\leadsto \frac{1 + \color{blue}{x \cdot \cos B}}{-\sin B} \]

                                if -3e-52 < F < 1.6499999999999999e-39

                                1. Initial program 76.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. Taylor expanded in F around 0

                                  \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                3. Step-by-step derivation
                                  1. lower-*.f64N/A

                                    \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                  2. lower-/.f64N/A

                                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                  3. lower-*.f64N/A

                                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                                  4. lower-cos.f64N/A

                                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                  5. lower-sin.f6455.8%

                                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                4. Applied rewrites55.8%

                                  \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                5. Step-by-step derivation
                                  1. lift-*.f64N/A

                                    \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                  2. metadata-evalN/A

                                    \[\leadsto \left(\mathsf{neg}\left(1\right)\right) \cdot \frac{\color{blue}{x \cdot \cos B}}{\sin B} \]
                                  3. distribute-lft-neg-outN/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                  4. lift-/.f64N/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                  5. lift-*.f64N/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                  6. associate-/l*N/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                                  7. div-flip-revN/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                  8. lift-sin.f64N/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                  9. lift-cos.f64N/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                  10. tan-quotN/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  11. lift-tan.f64N/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  12. lift-/.f64N/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  13. *-commutativeN/A

                                    \[\leadsto \mathsf{neg}\left(1 \cdot \left(\frac{1}{\tan B} \cdot x\right)\right) \]
                                  14. associate-*l*N/A

                                    \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                                  15. *-lft-identityN/A

                                    \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                                  16. *-commutativeN/A

                                    \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                6. Applied rewrites55.9%

                                  \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                                if 1.6499999999999999e-39 < F

                                1. Initial program 76.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. lift-+.f64N/A

                                    \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                  2. add-flipN/A

                                    \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right)} \]
                                  3. lift-*.f64N/A

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}\right)\right) \]
                                  4. lift-/.f64N/A

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right) \]
                                  5. associate-*l/N/A

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}\right)\right) \]
                                  6. distribute-neg-frac2N/A

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                  7. sub-to-fractionN/A

                                    \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                  8. lower-/.f64N/A

                                    \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                3. Applied rewrites85.1%

                                  \[\leadsto \color{blue}{\frac{\frac{-x}{\tan B} \cdot \left(-\sin B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B}} \]
                                4. Applied rewrites85.1%

                                  \[\leadsto \color{blue}{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F - \cos B \cdot x}{\sin B}} \]
                                5. Taylor expanded in F around inf

                                  \[\leadsto \frac{\color{blue}{1} - \cos B \cdot x}{\sin B} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites56.5%

                                    \[\leadsto \frac{\color{blue}{1} - \cos B \cdot x}{\sin B} \]
                                7. Recombined 3 regimes into one program.
                                8. Add Preprocessing

                                Alternative 17: 76.7% accurate, 1.5× speedup?

                                \[\begin{array}{l} \mathbf{if}\;F \leq -800000000000:\\ \;\;\;\;\frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B}\\ \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{elif}\;F \leq \frac{5057235284857433}{3064991081731777716716694054300618367237478244367204352}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
                                (FPCore (F B x)
                                  :precision binary64
                                  (if (<= F -800000000000)
                                  (/ (* -1 (* F (- (* -1 (/ x F)) (/ 1 F)))) (- (sin B)))
                                  (if (<=
                                       F
                                       -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512)
                                    (+
                                     (- (/ x B))
                                     (* (/ F B) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2)))))
                                    (if (<=
                                         F
                                         5057235284857433/3064991081731777716716694054300618367237478244367204352)
                                      (/ (- x) (tan B))
                                      (/ (- 1 (* (cos B) x)) (sin B))))))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= -800000000000.0) {
                                		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -sin(B);
                                	} else if (F <= -8.2e-259) {
                                		tmp = -(x / B) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                                	} else if (F <= 1.65e-39) {
                                		tmp = -x / tan(B);
                                	} else {
                                		tmp = (1.0 - (cos(B) * x)) / sin(B);
                                	}
                                	return tmp;
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(f, b, x)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: f
                                    real(8), intent (in) :: b
                                    real(8), intent (in) :: x
                                    real(8) :: tmp
                                    if (f <= (-800000000000.0d0)) then
                                        tmp = ((-1.0d0) * (f * (((-1.0d0) * (x / f)) - (1.0d0 / f)))) / -sin(b)
                                    else if (f <= (-8.2d-259)) then
                                        tmp = -(x / b) + ((f / b) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
                                    else if (f <= 1.65d-39) then
                                        tmp = -x / tan(b)
                                    else
                                        tmp = (1.0d0 - (cos(b) * x)) / sin(b)
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= -800000000000.0) {
                                		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -Math.sin(B);
                                	} else if (F <= -8.2e-259) {
                                		tmp = -(x / B) + ((F / B) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                                	} else if (F <= 1.65e-39) {
                                		tmp = -x / Math.tan(B);
                                	} else {
                                		tmp = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
                                	}
                                	return tmp;
                                }
                                
                                def code(F, B, x):
                                	tmp = 0
                                	if F <= -800000000000.0:
                                		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -math.sin(B)
                                	elif F <= -8.2e-259:
                                		tmp = -(x / B) + ((F / B) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
                                	elif F <= 1.65e-39:
                                		tmp = -x / math.tan(B)
                                	else:
                                		tmp = (1.0 - (math.cos(B) * x)) / math.sin(B)
                                	return tmp
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (F <= -800000000000.0)
                                		tmp = Float64(Float64(-1.0 * Float64(F * Float64(Float64(-1.0 * Float64(x / F)) - Float64(1.0 / F)))) / Float64(-sin(B)));
                                	elseif (F <= -8.2e-259)
                                		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
                                	elseif (F <= 1.65e-39)
                                		tmp = Float64(Float64(-x) / tan(B));
                                	else
                                		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(F, B, x)
                                	tmp = 0.0;
                                	if (F <= -800000000000.0)
                                		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -sin(B);
                                	elseif (F <= -8.2e-259)
                                		tmp = -(x / B) + ((F / B) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
                                	elseif (F <= 1.65e-39)
                                		tmp = -x / tan(B);
                                	else
                                		tmp = (1.0 - (cos(B) * x)) / sin(B);
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[F_, B_, x_] := If[LessEqual[F, -800000000000], N[(N[(-1 * N[(F * N[(N[(-1 * N[(x / F), $MachinePrecision]), $MachinePrecision] - N[(1 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2), $MachinePrecision] + N[(2 * x), $MachinePrecision]), $MachinePrecision], (-N[(1 / 2), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5057235284857433/3064991081731777716716694054300618367237478244367204352], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
                                
                                \begin{array}{l}
                                \mathbf{if}\;F \leq -800000000000:\\
                                \;\;\;\;\frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B}\\
                                
                                \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\
                                \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
                                
                                \mathbf{elif}\;F \leq \frac{5057235284857433}{3064991081731777716716694054300618367237478244367204352}:\\
                                \;\;\;\;\frac{-x}{\tan B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
                                
                                
                                \end{array}
                                
                                Derivation
                                1. Split input into 4 regimes
                                2. if F < -8e11

                                  1. Initial program 76.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. lift-+.f64N/A

                                      \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                    2. add-flipN/A

                                      \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right)} \]
                                    3. lift-*.f64N/A

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}\right)\right) \]
                                    4. lift-/.f64N/A

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right) \]
                                    5. associate-*l/N/A

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}\right)\right) \]
                                    6. distribute-neg-frac2N/A

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                    7. sub-to-fractionN/A

                                      \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                    8. lower-/.f64N/A

                                      \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                  3. Applied rewrites85.1%

                                    \[\leadsto \color{blue}{\frac{\frac{-x}{\tan B} \cdot \left(-\sin B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B}} \]
                                  4. Taylor expanded in F around -inf

                                    \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                  5. Step-by-step derivation
                                    1. lower-*.f64N/A

                                      \[\leadsto \frac{-1 \cdot \color{blue}{\left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                    2. lower-*.f64N/A

                                      \[\leadsto \frac{-1 \cdot \left(F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)}\right)}{-\sin B} \]
                                    3. lower--.f64N/A

                                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \color{blue}{\frac{1}{F}}\right)\right)}{-\sin B} \]
                                    4. lower-*.f64N/A

                                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{\color{blue}{1}}{F}\right)\right)}{-\sin B} \]
                                    5. lower-/.f64N/A

                                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                    6. lower-*.f64N/A

                                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                    7. lower-cos.f64N/A

                                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                    8. lower-/.f6451.4%

                                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                                  6. Applied rewrites51.4%

                                    \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                  7. Taylor expanded in B around 0

                                    \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                  8. Step-by-step derivation
                                    1. Applied rewrites35.9%

                                      \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]

                                    if -8e11 < F < -8.1999999999999996e-259

                                    1. Initial program 76.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. Taylor expanded in B around 0

                                      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f6449.2%

                                        \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    4. Applied rewrites49.2%

                                      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    5. Taylor expanded in B around 0

                                      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    6. Step-by-step derivation
                                      1. lower-/.f6435.5%

                                        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\color{blue}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    7. Applied rewrites35.5%

                                      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]

                                    if -8.1999999999999996e-259 < F < 1.6499999999999999e-39

                                    1. Initial program 76.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. Taylor expanded in F around 0

                                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                    3. Step-by-step derivation
                                      1. lower-*.f64N/A

                                        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                      2. lower-/.f64N/A

                                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                      3. lower-*.f64N/A

                                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                                      4. lower-cos.f64N/A

                                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                      5. lower-sin.f6455.8%

                                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                    4. Applied rewrites55.8%

                                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                    5. Step-by-step derivation
                                      1. lift-*.f64N/A

                                        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                      2. metadata-evalN/A

                                        \[\leadsto \left(\mathsf{neg}\left(1\right)\right) \cdot \frac{\color{blue}{x \cdot \cos B}}{\sin B} \]
                                      3. distribute-lft-neg-outN/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                      4. lift-/.f64N/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                      5. lift-*.f64N/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                      6. associate-/l*N/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                                      7. div-flip-revN/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                      8. lift-sin.f64N/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                      9. lift-cos.f64N/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                      10. tan-quotN/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      11. lift-tan.f64N/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      12. lift-/.f64N/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      13. *-commutativeN/A

                                        \[\leadsto \mathsf{neg}\left(1 \cdot \left(\frac{1}{\tan B} \cdot x\right)\right) \]
                                      14. associate-*l*N/A

                                        \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                                      15. *-lft-identityN/A

                                        \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                                      16. *-commutativeN/A

                                        \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                    6. Applied rewrites55.9%

                                      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                                    if 1.6499999999999999e-39 < F

                                    1. Initial program 76.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. lift-+.f64N/A

                                        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                      2. add-flipN/A

                                        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right)} \]
                                      3. lift-*.f64N/A

                                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}\right)\right) \]
                                      4. lift-/.f64N/A

                                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right) \]
                                      5. associate-*l/N/A

                                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}\right)\right) \]
                                      6. distribute-neg-frac2N/A

                                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                      7. sub-to-fractionN/A

                                        \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                      8. lower-/.f64N/A

                                        \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                    3. Applied rewrites85.1%

                                      \[\leadsto \color{blue}{\frac{\frac{-x}{\tan B} \cdot \left(-\sin B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B}} \]
                                    4. Applied rewrites85.1%

                                      \[\leadsto \color{blue}{\frac{{\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F - \cos B \cdot x}{\sin B}} \]
                                    5. Taylor expanded in F around inf

                                      \[\leadsto \frac{\color{blue}{1} - \cos B \cdot x}{\sin B} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites56.5%

                                        \[\leadsto \frac{\color{blue}{1} - \cos B \cdot x}{\sin B} \]
                                    7. Recombined 4 regimes into one program.
                                    8. Add Preprocessing

                                    Alternative 18: 71.6% accurate, 2.1× speedup?

                                    \[\begin{array}{l} t_0 := -\frac{x}{B}\\ \mathbf{if}\;F \leq -800000000000:\\ \;\;\;\;\frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B}\\ \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\ \;\;\;\;t\_0 + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{elif}\;F \leq 1850000000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{1}{\sin B}\\ \end{array} \]
                                    (FPCore (F B x)
                                      :precision binary64
                                      (let* ((t_0 (- (/ x B))))
                                      (if (<= F -800000000000)
                                        (/ (* -1 (* F (- (* -1 (/ x F)) (/ 1 F)))) (- (sin B)))
                                        (if (<=
                                             F
                                             -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512)
                                          (+ t_0 (* (/ F B) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2)))))
                                          (if (<= F 1850000000000)
                                            (/ (- x) (tan B))
                                            (+ t_0 (/ 1 (sin B))))))))
                                    double code(double F, double B, double x) {
                                    	double t_0 = -(x / B);
                                    	double tmp;
                                    	if (F <= -800000000000.0) {
                                    		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -sin(B);
                                    	} else if (F <= -8.2e-259) {
                                    		tmp = t_0 + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                                    	} else if (F <= 1850000000000.0) {
                                    		tmp = -x / tan(B);
                                    	} else {
                                    		tmp = t_0 + (1.0 / sin(B));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    module fmin_fmax_functions
                                        implicit none
                                        private
                                        public fmax
                                        public fmin
                                    
                                        interface fmax
                                            module procedure fmax88
                                            module procedure fmax44
                                            module procedure fmax84
                                            module procedure fmax48
                                        end interface
                                        interface fmin
                                            module procedure fmin88
                                            module procedure fmin44
                                            module procedure fmin84
                                            module procedure fmin48
                                        end interface
                                    contains
                                        real(8) function fmax88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmax44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmax84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmax48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmin44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmin48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                        end function
                                    end module
                                    
                                    real(8) function code(f, b, x)
                                    use fmin_fmax_functions
                                        real(8), intent (in) :: f
                                        real(8), intent (in) :: b
                                        real(8), intent (in) :: x
                                        real(8) :: t_0
                                        real(8) :: tmp
                                        t_0 = -(x / b)
                                        if (f <= (-800000000000.0d0)) then
                                            tmp = ((-1.0d0) * (f * (((-1.0d0) * (x / f)) - (1.0d0 / f)))) / -sin(b)
                                        else if (f <= (-8.2d-259)) then
                                            tmp = t_0 + ((f / b) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
                                        else if (f <= 1850000000000.0d0) then
                                            tmp = -x / tan(b)
                                        else
                                            tmp = t_0 + (1.0d0 / sin(b))
                                        end if
                                        code = tmp
                                    end function
                                    
                                    public static double code(double F, double B, double x) {
                                    	double t_0 = -(x / B);
                                    	double tmp;
                                    	if (F <= -800000000000.0) {
                                    		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -Math.sin(B);
                                    	} else if (F <= -8.2e-259) {
                                    		tmp = t_0 + ((F / B) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                                    	} else if (F <= 1850000000000.0) {
                                    		tmp = -x / Math.tan(B);
                                    	} else {
                                    		tmp = t_0 + (1.0 / Math.sin(B));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(F, B, x):
                                    	t_0 = -(x / B)
                                    	tmp = 0
                                    	if F <= -800000000000.0:
                                    		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -math.sin(B)
                                    	elif F <= -8.2e-259:
                                    		tmp = t_0 + ((F / B) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
                                    	elif F <= 1850000000000.0:
                                    		tmp = -x / math.tan(B)
                                    	else:
                                    		tmp = t_0 + (1.0 / math.sin(B))
                                    	return tmp
                                    
                                    function code(F, B, x)
                                    	t_0 = Float64(-Float64(x / B))
                                    	tmp = 0.0
                                    	if (F <= -800000000000.0)
                                    		tmp = Float64(Float64(-1.0 * Float64(F * Float64(Float64(-1.0 * Float64(x / F)) - Float64(1.0 / F)))) / Float64(-sin(B)));
                                    	elseif (F <= -8.2e-259)
                                    		tmp = Float64(t_0 + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
                                    	elseif (F <= 1850000000000.0)
                                    		tmp = Float64(Float64(-x) / tan(B));
                                    	else
                                    		tmp = Float64(t_0 + Float64(1.0 / sin(B)));
                                    	end
                                    	return tmp
                                    end
                                    
                                    function tmp_2 = code(F, B, x)
                                    	t_0 = -(x / B);
                                    	tmp = 0.0;
                                    	if (F <= -800000000000.0)
                                    		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -sin(B);
                                    	elseif (F <= -8.2e-259)
                                    		tmp = t_0 + ((F / B) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
                                    	elseif (F <= 1850000000000.0)
                                    		tmp = -x / tan(B);
                                    	else
                                    		tmp = t_0 + (1.0 / sin(B));
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -800000000000], N[(N[(-1 * N[(F * N[(N[(-1 * N[(x / F), $MachinePrecision]), $MachinePrecision] - N[(1 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, -3548786815231963/4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2), $MachinePrecision] + N[(2 * x), $MachinePrecision]), $MachinePrecision], (-N[(1 / 2), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1850000000000], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                    
                                    \begin{array}{l}
                                    t_0 := -\frac{x}{B}\\
                                    \mathbf{if}\;F \leq -800000000000:\\
                                    \;\;\;\;\frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B}\\
                                    
                                    \mathbf{elif}\;F \leq \frac{-3548786815231963}{4327788799063369698118367518036104040602397294887907509272254128346512609744690048814426160231687683233172643784762398137404191207445999921156415311568401014033503715319849649510248592805285405106374515984066055406780647774220793764564147394699562815402300054714269682368512}:\\
                                    \;\;\;\;t\_0 + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
                                    
                                    \mathbf{elif}\;F \leq 1850000000000:\\
                                    \;\;\;\;\frac{-x}{\tan B}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;t\_0 + \frac{1}{\sin B}\\
                                    
                                    
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 4 regimes
                                    2. if F < -8e11

                                      1. Initial program 76.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. lift-+.f64N/A

                                          \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                        2. add-flipN/A

                                          \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right)} \]
                                        3. lift-*.f64N/A

                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}\right)\right) \]
                                        4. lift-/.f64N/A

                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right) \]
                                        5. associate-*l/N/A

                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}\right)\right) \]
                                        6. distribute-neg-frac2N/A

                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                        7. sub-to-fractionN/A

                                          \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                        8. lower-/.f64N/A

                                          \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                      3. Applied rewrites85.1%

                                        \[\leadsto \color{blue}{\frac{\frac{-x}{\tan B} \cdot \left(-\sin B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B}} \]
                                      4. Taylor expanded in F around -inf

                                        \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                      5. Step-by-step derivation
                                        1. lower-*.f64N/A

                                          \[\leadsto \frac{-1 \cdot \color{blue}{\left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                        2. lower-*.f64N/A

                                          \[\leadsto \frac{-1 \cdot \left(F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)}\right)}{-\sin B} \]
                                        3. lower--.f64N/A

                                          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \color{blue}{\frac{1}{F}}\right)\right)}{-\sin B} \]
                                        4. lower-*.f64N/A

                                          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{\color{blue}{1}}{F}\right)\right)}{-\sin B} \]
                                        5. lower-/.f64N/A

                                          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                        6. lower-*.f64N/A

                                          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                        7. lower-cos.f64N/A

                                          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                        8. lower-/.f6451.4%

                                          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                                      6. Applied rewrites51.4%

                                        \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                      7. Taylor expanded in B around 0

                                        \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                      8. Step-by-step derivation
                                        1. Applied rewrites35.9%

                                          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]

                                        if -8e11 < F < -8.1999999999999996e-259

                                        1. Initial program 76.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. Taylor expanded in B around 0

                                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        3. Step-by-step derivation
                                          1. lower-/.f6449.2%

                                            \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        4. Applied rewrites49.2%

                                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        5. Taylor expanded in B around 0

                                          \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        6. Step-by-step derivation
                                          1. lower-/.f6435.5%

                                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\color{blue}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        7. Applied rewrites35.5%

                                          \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]

                                        if -8.1999999999999996e-259 < F < 1.85e12

                                        1. Initial program 76.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. Taylor expanded in F around 0

                                          \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                        3. Step-by-step derivation
                                          1. lower-*.f64N/A

                                            \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                          2. lower-/.f64N/A

                                            \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                          3. lower-*.f64N/A

                                            \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                                          4. lower-cos.f64N/A

                                            \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                          5. lower-sin.f6455.8%

                                            \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                        4. Applied rewrites55.8%

                                          \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                        5. Step-by-step derivation
                                          1. lift-*.f64N/A

                                            \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                          2. metadata-evalN/A

                                            \[\leadsto \left(\mathsf{neg}\left(1\right)\right) \cdot \frac{\color{blue}{x \cdot \cos B}}{\sin B} \]
                                          3. distribute-lft-neg-outN/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                          4. lift-/.f64N/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                          5. lift-*.f64N/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                          6. associate-/l*N/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                                          7. div-flip-revN/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                          8. lift-sin.f64N/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                          9. lift-cos.f64N/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                          10. tan-quotN/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          11. lift-tan.f64N/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          12. lift-/.f64N/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          13. *-commutativeN/A

                                            \[\leadsto \mathsf{neg}\left(1 \cdot \left(\frac{1}{\tan B} \cdot x\right)\right) \]
                                          14. associate-*l*N/A

                                            \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                                          15. *-lft-identityN/A

                                            \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                                          16. *-commutativeN/A

                                            \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                        6. Applied rewrites55.9%

                                          \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                                        if 1.85e12 < F

                                        1. Initial program 76.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. Taylor expanded in B around 0

                                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        3. Step-by-step derivation
                                          1. lower-/.f6449.2%

                                            \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        4. Applied rewrites49.2%

                                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        5. Taylor expanded in F around inf

                                          \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                        6. Step-by-step derivation
                                          1. lower-/.f64N/A

                                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                                          2. lower-sin.f6436.4%

                                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{1}{\sin B} \]
                                        7. Applied rewrites36.4%

                                          \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                      9. Recombined 4 regimes into one program.
                                      10. Add Preprocessing

                                      Alternative 19: 71.0% accurate, 2.3× speedup?

                                      \[\begin{array}{l} \mathbf{if}\;F \leq \frac{-631383297997835}{332306998946228968225951765070086144}:\\ \;\;\;\;\frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B}\\ \mathbf{elif}\;F \leq 1850000000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sin B}\\ \end{array} \]
                                      (FPCore (F B x)
                                        :precision binary64
                                        (if (<= F -631383297997835/332306998946228968225951765070086144)
                                        (/ (* -1 (* F (- (* -1 (/ x F)) (/ 1 F)))) (- (sin B)))
                                        (if (<= F 1850000000000)
                                          (/ (- x) (tan B))
                                          (+ (- (/ x B)) (/ 1 (sin B))))))
                                      double code(double F, double B, double x) {
                                      	double tmp;
                                      	if (F <= -1.9e-21) {
                                      		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -sin(B);
                                      	} else if (F <= 1850000000000.0) {
                                      		tmp = -x / tan(B);
                                      	} else {
                                      		tmp = -(x / B) + (1.0 / sin(B));
                                      	}
                                      	return tmp;
                                      }
                                      
                                      module fmin_fmax_functions
                                          implicit none
                                          private
                                          public fmax
                                          public fmin
                                      
                                          interface fmax
                                              module procedure fmax88
                                              module procedure fmax44
                                              module procedure fmax84
                                              module procedure fmax48
                                          end interface
                                          interface fmin
                                              module procedure fmin88
                                              module procedure fmin44
                                              module procedure fmin84
                                              module procedure fmin48
                                          end interface
                                      contains
                                          real(8) function fmax88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmax44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmax84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmax48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmin44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmin48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                          end function
                                      end module
                                      
                                      real(8) function code(f, b, x)
                                      use fmin_fmax_functions
                                          real(8), intent (in) :: f
                                          real(8), intent (in) :: b
                                          real(8), intent (in) :: x
                                          real(8) :: tmp
                                          if (f <= (-1.9d-21)) then
                                              tmp = ((-1.0d0) * (f * (((-1.0d0) * (x / f)) - (1.0d0 / f)))) / -sin(b)
                                          else if (f <= 1850000000000.0d0) then
                                              tmp = -x / tan(b)
                                          else
                                              tmp = -(x / b) + (1.0d0 / sin(b))
                                          end if
                                          code = tmp
                                      end function
                                      
                                      public static double code(double F, double B, double x) {
                                      	double tmp;
                                      	if (F <= -1.9e-21) {
                                      		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -Math.sin(B);
                                      	} else if (F <= 1850000000000.0) {
                                      		tmp = -x / Math.tan(B);
                                      	} else {
                                      		tmp = -(x / B) + (1.0 / Math.sin(B));
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(F, B, x):
                                      	tmp = 0
                                      	if F <= -1.9e-21:
                                      		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -math.sin(B)
                                      	elif F <= 1850000000000.0:
                                      		tmp = -x / math.tan(B)
                                      	else:
                                      		tmp = -(x / B) + (1.0 / math.sin(B))
                                      	return tmp
                                      
                                      function code(F, B, x)
                                      	tmp = 0.0
                                      	if (F <= -1.9e-21)
                                      		tmp = Float64(Float64(-1.0 * Float64(F * Float64(Float64(-1.0 * Float64(x / F)) - Float64(1.0 / F)))) / Float64(-sin(B)));
                                      	elseif (F <= 1850000000000.0)
                                      		tmp = Float64(Float64(-x) / tan(B));
                                      	else
                                      		tmp = Float64(Float64(-Float64(x / B)) + Float64(1.0 / sin(B)));
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(F, B, x)
                                      	tmp = 0.0;
                                      	if (F <= -1.9e-21)
                                      		tmp = (-1.0 * (F * ((-1.0 * (x / F)) - (1.0 / F)))) / -sin(B);
                                      	elseif (F <= 1850000000000.0)
                                      		tmp = -x / tan(B);
                                      	else
                                      		tmp = -(x / B) + (1.0 / sin(B));
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[F_, B_, x_] := If[LessEqual[F, -631383297997835/332306998946228968225951765070086144], N[(N[(-1 * N[(F * N[(N[(-1 * N[(x / F), $MachinePrecision]), $MachinePrecision] - N[(1 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1850000000000], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                      
                                      \begin{array}{l}
                                      \mathbf{if}\;F \leq \frac{-631383297997835}{332306998946228968225951765070086144}:\\
                                      \;\;\;\;\frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B}\\
                                      
                                      \mathbf{elif}\;F \leq 1850000000000:\\
                                      \;\;\;\;\frac{-x}{\tan B}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sin B}\\
                                      
                                      
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if F < -1.8999999999999999e-21

                                        1. Initial program 76.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. lift-+.f64N/A

                                            \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                          2. add-flipN/A

                                            \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right)} \]
                                          3. lift-*.f64N/A

                                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}\right)\right) \]
                                          4. lift-/.f64N/A

                                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right) \]
                                          5. associate-*l/N/A

                                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}\right)\right) \]
                                          6. distribute-neg-frac2N/A

                                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                          7. sub-to-fractionN/A

                                            \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                          8. lower-/.f64N/A

                                            \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                        3. Applied rewrites85.1%

                                          \[\leadsto \color{blue}{\frac{\frac{-x}{\tan B} \cdot \left(-\sin B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B}} \]
                                        4. Taylor expanded in F around -inf

                                          \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                        5. Step-by-step derivation
                                          1. lower-*.f64N/A

                                            \[\leadsto \frac{-1 \cdot \color{blue}{\left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                          2. lower-*.f64N/A

                                            \[\leadsto \frac{-1 \cdot \left(F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)}\right)}{-\sin B} \]
                                          3. lower--.f64N/A

                                            \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \color{blue}{\frac{1}{F}}\right)\right)}{-\sin B} \]
                                          4. lower-*.f64N/A

                                            \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{\color{blue}{1}}{F}\right)\right)}{-\sin B} \]
                                          5. lower-/.f64N/A

                                            \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                          6. lower-*.f64N/A

                                            \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                          7. lower-cos.f64N/A

                                            \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                          8. lower-/.f6451.4%

                                            \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{\color{blue}{F}}\right)\right)}{-\sin B} \]
                                        6. Applied rewrites51.4%

                                          \[\leadsto \frac{\color{blue}{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F} - \frac{1}{F}\right)\right)}}{-\sin B} \]
                                        7. Taylor expanded in B around 0

                                          \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]
                                        8. Step-by-step derivation
                                          1. Applied rewrites35.9%

                                            \[\leadsto \frac{-1 \cdot \left(F \cdot \left(-1 \cdot \frac{x}{F} - \frac{1}{F}\right)\right)}{-\sin B} \]

                                          if -1.8999999999999999e-21 < F < 1.85e12

                                          1. Initial program 76.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. Taylor expanded in F around 0

                                            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                          3. Step-by-step derivation
                                            1. lower-*.f64N/A

                                              \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                            2. lower-/.f64N/A

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                            3. lower-*.f64N/A

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                                            4. lower-cos.f64N/A

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                            5. lower-sin.f6455.8%

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                          4. Applied rewrites55.8%

                                            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                          5. Step-by-step derivation
                                            1. lift-*.f64N/A

                                              \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                            2. metadata-evalN/A

                                              \[\leadsto \left(\mathsf{neg}\left(1\right)\right) \cdot \frac{\color{blue}{x \cdot \cos B}}{\sin B} \]
                                            3. distribute-lft-neg-outN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                            4. lift-/.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                            5. lift-*.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                            6. associate-/l*N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                                            7. div-flip-revN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                            8. lift-sin.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                            9. lift-cos.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                            10. tan-quotN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            11. lift-tan.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            12. lift-/.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            13. *-commutativeN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(\frac{1}{\tan B} \cdot x\right)\right) \]
                                            14. associate-*l*N/A

                                              \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                                            15. *-lft-identityN/A

                                              \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                                            16. *-commutativeN/A

                                              \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                          6. Applied rewrites55.9%

                                            \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                                          if 1.85e12 < F

                                          1. Initial program 76.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. Taylor expanded in B around 0

                                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f6449.2%

                                              \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          4. Applied rewrites49.2%

                                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          5. Taylor expanded in F around inf

                                            \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                          6. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                                            2. lower-sin.f6436.4%

                                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{1}{\sin B} \]
                                          7. Applied rewrites36.4%

                                            \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                        9. Recombined 3 regimes into one program.
                                        10. Add Preprocessing

                                        Alternative 20: 69.6% accurate, 2.6× speedup?

                                        \[\begin{array}{l} t_0 := -\frac{x}{B}\\ \mathbf{if}\;F \leq \frac{-631383297997835}{332306998946228968225951765070086144}:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1850000000000:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{1}{\sin B}\\ \end{array} \]
                                        (FPCore (F B x)
                                          :precision binary64
                                          (let* ((t_0 (- (/ x B))))
                                          (if (<= F -631383297997835/332306998946228968225951765070086144)
                                            (+ t_0 (/ -1 (sin B)))
                                            (if (<= F 1850000000000)
                                              (/ (- x) (tan B))
                                              (+ t_0 (/ 1 (sin B)))))))
                                        double code(double F, double B, double x) {
                                        	double t_0 = -(x / B);
                                        	double tmp;
                                        	if (F <= -1.9e-21) {
                                        		tmp = t_0 + (-1.0 / sin(B));
                                        	} else if (F <= 1850000000000.0) {
                                        		tmp = -x / tan(B);
                                        	} else {
                                        		tmp = t_0 + (1.0 / sin(B));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        module fmin_fmax_functions
                                            implicit none
                                            private
                                            public fmax
                                            public fmin
                                        
                                            interface fmax
                                                module procedure fmax88
                                                module procedure fmax44
                                                module procedure fmax84
                                                module procedure fmax48
                                            end interface
                                            interface fmin
                                                module procedure fmin88
                                                module procedure fmin44
                                                module procedure fmin84
                                                module procedure fmin48
                                            end interface
                                        contains
                                            real(8) function fmax88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmax44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmax84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmax48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmin44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmin48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                            end function
                                        end module
                                        
                                        real(8) function code(f, b, x)
                                        use fmin_fmax_functions
                                            real(8), intent (in) :: f
                                            real(8), intent (in) :: b
                                            real(8), intent (in) :: x
                                            real(8) :: t_0
                                            real(8) :: tmp
                                            t_0 = -(x / b)
                                            if (f <= (-1.9d-21)) then
                                                tmp = t_0 + ((-1.0d0) / sin(b))
                                            else if (f <= 1850000000000.0d0) then
                                                tmp = -x / tan(b)
                                            else
                                                tmp = t_0 + (1.0d0 / sin(b))
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double F, double B, double x) {
                                        	double t_0 = -(x / B);
                                        	double tmp;
                                        	if (F <= -1.9e-21) {
                                        		tmp = t_0 + (-1.0 / Math.sin(B));
                                        	} else if (F <= 1850000000000.0) {
                                        		tmp = -x / Math.tan(B);
                                        	} else {
                                        		tmp = t_0 + (1.0 / Math.sin(B));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(F, B, x):
                                        	t_0 = -(x / B)
                                        	tmp = 0
                                        	if F <= -1.9e-21:
                                        		tmp = t_0 + (-1.0 / math.sin(B))
                                        	elif F <= 1850000000000.0:
                                        		tmp = -x / math.tan(B)
                                        	else:
                                        		tmp = t_0 + (1.0 / math.sin(B))
                                        	return tmp
                                        
                                        function code(F, B, x)
                                        	t_0 = Float64(-Float64(x / B))
                                        	tmp = 0.0
                                        	if (F <= -1.9e-21)
                                        		tmp = Float64(t_0 + Float64(-1.0 / sin(B)));
                                        	elseif (F <= 1850000000000.0)
                                        		tmp = Float64(Float64(-x) / tan(B));
                                        	else
                                        		tmp = Float64(t_0 + Float64(1.0 / sin(B)));
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(F, B, x)
                                        	t_0 = -(x / B);
                                        	tmp = 0.0;
                                        	if (F <= -1.9e-21)
                                        		tmp = t_0 + (-1.0 / sin(B));
                                        	elseif (F <= 1850000000000.0)
                                        		tmp = -x / tan(B);
                                        	else
                                        		tmp = t_0 + (1.0 / sin(B));
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -631383297997835/332306998946228968225951765070086144], N[(t$95$0 + N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1850000000000], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                        
                                        \begin{array}{l}
                                        t_0 := -\frac{x}{B}\\
                                        \mathbf{if}\;F \leq \frac{-631383297997835}{332306998946228968225951765070086144}:\\
                                        \;\;\;\;t\_0 + \frac{-1}{\sin B}\\
                                        
                                        \mathbf{elif}\;F \leq 1850000000000:\\
                                        \;\;\;\;\frac{-x}{\tan B}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;t\_0 + \frac{1}{\sin B}\\
                                        
                                        
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if F < -1.8999999999999999e-21

                                          1. Initial program 76.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. Taylor expanded in B around 0

                                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f6449.2%

                                              \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          4. Applied rewrites49.2%

                                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          5. Taylor expanded in F around -inf

                                            \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                          6. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                                            2. lower-sin.f6435.7%

                                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{\sin B} \]
                                          7. Applied rewrites35.7%

                                            \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]

                                          if -1.8999999999999999e-21 < F < 1.85e12

                                          1. Initial program 76.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. Taylor expanded in F around 0

                                            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                          3. Step-by-step derivation
                                            1. lower-*.f64N/A

                                              \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                            2. lower-/.f64N/A

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                            3. lower-*.f64N/A

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                                            4. lower-cos.f64N/A

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                            5. lower-sin.f6455.8%

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                          4. Applied rewrites55.8%

                                            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                          5. Step-by-step derivation
                                            1. lift-*.f64N/A

                                              \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                            2. metadata-evalN/A

                                              \[\leadsto \left(\mathsf{neg}\left(1\right)\right) \cdot \frac{\color{blue}{x \cdot \cos B}}{\sin B} \]
                                            3. distribute-lft-neg-outN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                            4. lift-/.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                            5. lift-*.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                            6. associate-/l*N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                                            7. div-flip-revN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                            8. lift-sin.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                            9. lift-cos.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                            10. tan-quotN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            11. lift-tan.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            12. lift-/.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            13. *-commutativeN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(\frac{1}{\tan B} \cdot x\right)\right) \]
                                            14. associate-*l*N/A

                                              \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                                            15. *-lft-identityN/A

                                              \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                                            16. *-commutativeN/A

                                              \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                          6. Applied rewrites55.9%

                                            \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                                          if 1.85e12 < F

                                          1. Initial program 76.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. Taylor expanded in B around 0

                                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f6449.2%

                                              \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          4. Applied rewrites49.2%

                                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          5. Taylor expanded in F around inf

                                            \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                          6. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                                            2. lower-sin.f6436.4%

                                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{1}{\sin B} \]
                                          7. Applied rewrites36.4%

                                            \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                                        3. Recombined 3 regimes into one program.
                                        4. Add Preprocessing

                                        Alternative 21: 63.6% accurate, 2.7× speedup?

                                        \[\begin{array}{l} \mathbf{if}\;F \leq \frac{-631383297997835}{332306998946228968225951765070086144}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2800000000000000113078950170696485178350383232651583988151595665389099233453737098594544983240697983719967744055948864694408373044400218446508962682114742997152086973947001523074882120184614624849536236760622355503693081243909389889239515136:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{-\sin B}\\ \end{array} \]
                                        (FPCore (F B x)
                                          :precision binary64
                                          (if (<= F -631383297997835/332306998946228968225951765070086144)
                                          (+ (- (/ x B)) (/ -1 (sin B)))
                                          (if (<=
                                               F
                                               2800000000000000113078950170696485178350383232651583988151595665389099233453737098594544983240697983719967744055948864694408373044400218446508962682114742997152086973947001523074882120184614624849536236760622355503693081243909389889239515136)
                                            (/ (- x) (tan B))
                                            (/ -1 (- (sin B))))))
                                        double code(double F, double B, double x) {
                                        	double tmp;
                                        	if (F <= -1.9e-21) {
                                        		tmp = -(x / B) + (-1.0 / sin(B));
                                        	} else if (F <= 2.8e+240) {
                                        		tmp = -x / tan(B);
                                        	} else {
                                        		tmp = -1.0 / -sin(B);
                                        	}
                                        	return tmp;
                                        }
                                        
                                        module fmin_fmax_functions
                                            implicit none
                                            private
                                            public fmax
                                            public fmin
                                        
                                            interface fmax
                                                module procedure fmax88
                                                module procedure fmax44
                                                module procedure fmax84
                                                module procedure fmax48
                                            end interface
                                            interface fmin
                                                module procedure fmin88
                                                module procedure fmin44
                                                module procedure fmin84
                                                module procedure fmin48
                                            end interface
                                        contains
                                            real(8) function fmax88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmax44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmax84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmax48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmin44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmin48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                            end function
                                        end module
                                        
                                        real(8) function code(f, b, x)
                                        use fmin_fmax_functions
                                            real(8), intent (in) :: f
                                            real(8), intent (in) :: b
                                            real(8), intent (in) :: x
                                            real(8) :: tmp
                                            if (f <= (-1.9d-21)) then
                                                tmp = -(x / b) + ((-1.0d0) / sin(b))
                                            else if (f <= 2.8d+240) then
                                                tmp = -x / tan(b)
                                            else
                                                tmp = (-1.0d0) / -sin(b)
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double F, double B, double x) {
                                        	double tmp;
                                        	if (F <= -1.9e-21) {
                                        		tmp = -(x / B) + (-1.0 / Math.sin(B));
                                        	} else if (F <= 2.8e+240) {
                                        		tmp = -x / Math.tan(B);
                                        	} else {
                                        		tmp = -1.0 / -Math.sin(B);
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(F, B, x):
                                        	tmp = 0
                                        	if F <= -1.9e-21:
                                        		tmp = -(x / B) + (-1.0 / math.sin(B))
                                        	elif F <= 2.8e+240:
                                        		tmp = -x / math.tan(B)
                                        	else:
                                        		tmp = -1.0 / -math.sin(B)
                                        	return tmp
                                        
                                        function code(F, B, x)
                                        	tmp = 0.0
                                        	if (F <= -1.9e-21)
                                        		tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B)));
                                        	elseif (F <= 2.8e+240)
                                        		tmp = Float64(Float64(-x) / tan(B));
                                        	else
                                        		tmp = Float64(-1.0 / Float64(-sin(B)));
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(F, B, x)
                                        	tmp = 0.0;
                                        	if (F <= -1.9e-21)
                                        		tmp = -(x / B) + (-1.0 / sin(B));
                                        	elseif (F <= 2.8e+240)
                                        		tmp = -x / tan(B);
                                        	else
                                        		tmp = -1.0 / -sin(B);
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[F_, B_, x_] := If[LessEqual[F, -631383297997835/332306998946228968225951765070086144], N[((-N[(x / B), $MachinePrecision]) + N[(-1 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2800000000000000113078950170696485178350383232651583988151595665389099233453737098594544983240697983719967744055948864694408373044400218446508962682114742997152086973947001523074882120184614624849536236760622355503693081243909389889239515136], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(-1 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]]]
                                        
                                        \begin{array}{l}
                                        \mathbf{if}\;F \leq \frac{-631383297997835}{332306998946228968225951765070086144}:\\
                                        \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
                                        
                                        \mathbf{elif}\;F \leq 2800000000000000113078950170696485178350383232651583988151595665389099233453737098594544983240697983719967744055948864694408373044400218446508962682114742997152086973947001523074882120184614624849536236760622355503693081243909389889239515136:\\
                                        \;\;\;\;\frac{-x}{\tan B}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{-1}{-\sin B}\\
                                        
                                        
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if F < -1.8999999999999999e-21

                                          1. Initial program 76.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. Taylor expanded in B around 0

                                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f6449.2%

                                              \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          4. Applied rewrites49.2%

                                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          5. Taylor expanded in F around -inf

                                            \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                          6. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                                            2. lower-sin.f6435.7%

                                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{\sin B} \]
                                          7. Applied rewrites35.7%

                                            \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]

                                          if -1.8999999999999999e-21 < F < 2.8000000000000001e240

                                          1. Initial program 76.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. Taylor expanded in F around 0

                                            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                          3. Step-by-step derivation
                                            1. lower-*.f64N/A

                                              \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                            2. lower-/.f64N/A

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                            3. lower-*.f64N/A

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                                            4. lower-cos.f64N/A

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                            5. lower-sin.f6455.8%

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                          4. Applied rewrites55.8%

                                            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                          5. Step-by-step derivation
                                            1. lift-*.f64N/A

                                              \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                            2. metadata-evalN/A

                                              \[\leadsto \left(\mathsf{neg}\left(1\right)\right) \cdot \frac{\color{blue}{x \cdot \cos B}}{\sin B} \]
                                            3. distribute-lft-neg-outN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                            4. lift-/.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                            5. lift-*.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                            6. associate-/l*N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                                            7. div-flip-revN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                            8. lift-sin.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                            9. lift-cos.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                            10. tan-quotN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            11. lift-tan.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            12. lift-/.f64N/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            13. *-commutativeN/A

                                              \[\leadsto \mathsf{neg}\left(1 \cdot \left(\frac{1}{\tan B} \cdot x\right)\right) \]
                                            14. associate-*l*N/A

                                              \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                                            15. *-lft-identityN/A

                                              \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                                            16. *-commutativeN/A

                                              \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                          6. Applied rewrites55.9%

                                            \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                                          if 2.8000000000000001e240 < F

                                          1. Initial program 76.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. lift-+.f64N/A

                                              \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                            2. add-flipN/A

                                              \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right)} \]
                                            3. lift-*.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}\right)\right) \]
                                            4. lift-/.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right) \]
                                            5. associate-*l/N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}\right)\right) \]
                                            6. distribute-neg-frac2N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                            7. sub-to-fractionN/A

                                              \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                            8. lower-/.f64N/A

                                              \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                          3. Applied rewrites85.1%

                                            \[\leadsto \color{blue}{\frac{\frac{-x}{\tan B} \cdot \left(-\sin B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B}} \]
                                          4. Taylor expanded in F around inf

                                            \[\leadsto \frac{\color{blue}{-1}}{-\sin B} \]
                                          5. Step-by-step derivation
                                            1. Applied rewrites17.1%

                                              \[\leadsto \frac{\color{blue}{-1}}{-\sin B} \]
                                          6. Recombined 3 regimes into one program.
                                          7. Add Preprocessing

                                          Alternative 22: 56.1% accurate, 3.1× speedup?

                                          \[\begin{array}{l} \mathbf{if}\;F \leq 2800000000000000113078950170696485178350383232651583988151595665389099233453737098594544983240697983719967744055948864694408373044400218446508962682114742997152086973947001523074882120184614624849536236760622355503693081243909389889239515136:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{-\sin B}\\ \end{array} \]
                                          (FPCore (F B x)
                                            :precision binary64
                                            (if (<=
                                               F
                                               2800000000000000113078950170696485178350383232651583988151595665389099233453737098594544983240697983719967744055948864694408373044400218446508962682114742997152086973947001523074882120184614624849536236760622355503693081243909389889239515136)
                                            (/ (- x) (tan B))
                                            (/ -1 (- (sin B)))))
                                          double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= 2.8e+240) {
                                          		tmp = -x / tan(B);
                                          	} else {
                                          		tmp = -1.0 / -sin(B);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          module fmin_fmax_functions
                                              implicit none
                                              private
                                              public fmax
                                              public fmin
                                          
                                              interface fmax
                                                  module procedure fmax88
                                                  module procedure fmax44
                                                  module procedure fmax84
                                                  module procedure fmax48
                                              end interface
                                              interface fmin
                                                  module procedure fmin88
                                                  module procedure fmin44
                                                  module procedure fmin84
                                                  module procedure fmin48
                                              end interface
                                          contains
                                              real(8) function fmax88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmax44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmax84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmax48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmin44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmin48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                              end function
                                          end module
                                          
                                          real(8) function code(f, b, x)
                                          use fmin_fmax_functions
                                              real(8), intent (in) :: f
                                              real(8), intent (in) :: b
                                              real(8), intent (in) :: x
                                              real(8) :: tmp
                                              if (f <= 2.8d+240) then
                                                  tmp = -x / tan(b)
                                              else
                                                  tmp = (-1.0d0) / -sin(b)
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= 2.8e+240) {
                                          		tmp = -x / Math.tan(B);
                                          	} else {
                                          		tmp = -1.0 / -Math.sin(B);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(F, B, x):
                                          	tmp = 0
                                          	if F <= 2.8e+240:
                                          		tmp = -x / math.tan(B)
                                          	else:
                                          		tmp = -1.0 / -math.sin(B)
                                          	return tmp
                                          
                                          function code(F, B, x)
                                          	tmp = 0.0
                                          	if (F <= 2.8e+240)
                                          		tmp = Float64(Float64(-x) / tan(B));
                                          	else
                                          		tmp = Float64(-1.0 / Float64(-sin(B)));
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(F, B, x)
                                          	tmp = 0.0;
                                          	if (F <= 2.8e+240)
                                          		tmp = -x / tan(B);
                                          	else
                                          		tmp = -1.0 / -sin(B);
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[F_, B_, x_] := If[LessEqual[F, 2800000000000000113078950170696485178350383232651583988151595665389099233453737098594544983240697983719967744055948864694408373044400218446508962682114742997152086973947001523074882120184614624849536236760622355503693081243909389889239515136], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(-1 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          \mathbf{if}\;F \leq 2800000000000000113078950170696485178350383232651583988151595665389099233453737098594544983240697983719967744055948864694408373044400218446508962682114742997152086973947001523074882120184614624849536236760622355503693081243909389889239515136:\\
                                          \;\;\;\;\frac{-x}{\tan B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{-1}{-\sin B}\\
                                          
                                          
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if F < 2.8000000000000001e240

                                            1. Initial program 76.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. Taylor expanded in F around 0

                                              \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                            3. Step-by-step derivation
                                              1. lower-*.f64N/A

                                                \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                              2. lower-/.f64N/A

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                              3. lower-*.f64N/A

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                                              4. lower-cos.f64N/A

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                              5. lower-sin.f6455.8%

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                            4. Applied rewrites55.8%

                                              \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                            5. Step-by-step derivation
                                              1. lift-*.f64N/A

                                                \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                              2. metadata-evalN/A

                                                \[\leadsto \left(\mathsf{neg}\left(1\right)\right) \cdot \frac{\color{blue}{x \cdot \cos B}}{\sin B} \]
                                              3. distribute-lft-neg-outN/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                              4. lift-/.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                              5. lift-*.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                              6. associate-/l*N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                                              7. div-flip-revN/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                              8. lift-sin.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                              9. lift-cos.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                              10. tan-quotN/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                              11. lift-tan.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                              12. lift-/.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                              13. *-commutativeN/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(\frac{1}{\tan B} \cdot x\right)\right) \]
                                              14. associate-*l*N/A

                                                \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                                              15. *-lft-identityN/A

                                                \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                                              16. *-commutativeN/A

                                                \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                            6. Applied rewrites55.9%

                                              \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                                            if 2.8000000000000001e240 < F

                                            1. Initial program 76.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. lift-+.f64N/A

                                                \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                              2. add-flipN/A

                                                \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right)} \]
                                              3. lift-*.f64N/A

                                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}\right)\right) \]
                                              4. lift-/.f64N/A

                                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\right)\right) \]
                                              5. associate-*l/N/A

                                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}}\right)\right) \]
                                              6. distribute-neg-frac2N/A

                                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                              7. sub-to-fractionN/A

                                                \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                              8. lower-/.f64N/A

                                                \[\leadsto \color{blue}{\frac{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(\mathsf{neg}\left(\sin B\right)\right) - F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\mathsf{neg}\left(\sin B\right)}} \]
                                            3. Applied rewrites85.1%

                                              \[\leadsto \color{blue}{\frac{\frac{-x}{\tan B} \cdot \left(-\sin B\right) - {\left(\left(x + x\right) - \left(-2 - F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F}{-\sin B}} \]
                                            4. Taylor expanded in F around inf

                                              \[\leadsto \frac{\color{blue}{-1}}{-\sin B} \]
                                            5. Step-by-step derivation
                                              1. Applied rewrites17.1%

                                                \[\leadsto \frac{\color{blue}{-1}}{-\sin B} \]
                                            6. Recombined 2 regimes into one program.
                                            7. Add Preprocessing

                                            Alternative 23: 55.9% accurate, 3.2× speedup?

                                            \[\frac{-x}{\tan B} \]
                                            (FPCore (F B x)
                                              :precision binary64
                                              (/ (- x) (tan B)))
                                            double code(double F, double B, double x) {
                                            	return -x / tan(B);
                                            }
                                            
                                            module fmin_fmax_functions
                                                implicit none
                                                private
                                                public fmax
                                                public fmin
                                            
                                                interface fmax
                                                    module procedure fmax88
                                                    module procedure fmax44
                                                    module procedure fmax84
                                                    module procedure fmax48
                                                end interface
                                                interface fmin
                                                    module procedure fmin88
                                                    module procedure fmin44
                                                    module procedure fmin84
                                                    module procedure fmin48
                                                end interface
                                            contains
                                                real(8) function fmax88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmax44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmax84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmax48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmin44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmin48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                end function
                                            end module
                                            
                                            real(8) function code(f, b, x)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: f
                                                real(8), intent (in) :: b
                                                real(8), intent (in) :: x
                                                code = -x / tan(b)
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	return -x / Math.tan(B);
                                            }
                                            
                                            def code(F, B, x):
                                            	return -x / math.tan(B)
                                            
                                            function code(F, B, x)
                                            	return Float64(Float64(-x) / tan(B))
                                            end
                                            
                                            function tmp = code(F, B, x)
                                            	tmp = -x / tan(B);
                                            end
                                            
                                            code[F_, B_, x_] := N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]
                                            
                                            \frac{-x}{\tan B}
                                            
                                            Derivation
                                            1. Initial program 76.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. Taylor expanded in F around 0

                                              \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                            3. Step-by-step derivation
                                              1. lower-*.f64N/A

                                                \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                              2. lower-/.f64N/A

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                              3. lower-*.f64N/A

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                                              4. lower-cos.f64N/A

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                              5. lower-sin.f6455.8%

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                            4. Applied rewrites55.8%

                                              \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                            5. Step-by-step derivation
                                              1. lift-*.f64N/A

                                                \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                                              2. metadata-evalN/A

                                                \[\leadsto \left(\mathsf{neg}\left(1\right)\right) \cdot \frac{\color{blue}{x \cdot \cos B}}{\sin B} \]
                                              3. distribute-lft-neg-outN/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                              4. lift-/.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                              5. lift-*.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \frac{x \cdot \cos B}{\sin B}\right) \]
                                              6. associate-/l*N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{\cos B}{\sin B}\right)\right) \]
                                              7. div-flip-revN/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                              8. lift-sin.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                              9. lift-cos.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right)\right) \]
                                              10. tan-quotN/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                              11. lift-tan.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                              12. lift-/.f64N/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                              13. *-commutativeN/A

                                                \[\leadsto \mathsf{neg}\left(1 \cdot \left(\frac{1}{\tan B} \cdot x\right)\right) \]
                                              14. associate-*l*N/A

                                                \[\leadsto \mathsf{neg}\left(\left(1 \cdot \frac{1}{\tan B}\right) \cdot x\right) \]
                                              15. *-lft-identityN/A

                                                \[\leadsto \mathsf{neg}\left(\frac{1}{\tan B} \cdot x\right) \]
                                              16. *-commutativeN/A

                                                \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                            6. Applied rewrites55.9%

                                              \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                            7. Add Preprocessing

                                            Alternative 24: 21.3% accurate, 8.4× speedup?

                                            \[\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot \frac{-1}{F} \]
                                            (FPCore (F B x)
                                              :precision binary64
                                              (+ (- (/ x B)) (* (/ F B) (/ -1 F))))
                                            double code(double F, double B, double x) {
                                            	return -(x / B) + ((F / B) * (-1.0 / F));
                                            }
                                            
                                            module fmin_fmax_functions
                                                implicit none
                                                private
                                                public fmax
                                                public fmin
                                            
                                                interface fmax
                                                    module procedure fmax88
                                                    module procedure fmax44
                                                    module procedure fmax84
                                                    module procedure fmax48
                                                end interface
                                                interface fmin
                                                    module procedure fmin88
                                                    module procedure fmin44
                                                    module procedure fmin84
                                                    module procedure fmin48
                                                end interface
                                            contains
                                                real(8) function fmax88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmax44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmax84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmax48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmin44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmin48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                end function
                                            end module
                                            
                                            real(8) function code(f, b, x)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: f
                                                real(8), intent (in) :: b
                                                real(8), intent (in) :: x
                                                code = -(x / b) + ((f / b) * ((-1.0d0) / f))
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	return -(x / B) + ((F / B) * (-1.0 / F));
                                            }
                                            
                                            def code(F, B, x):
                                            	return -(x / B) + ((F / B) * (-1.0 / F))
                                            
                                            function code(F, B, x)
                                            	return Float64(Float64(-Float64(x / B)) + Float64(Float64(F / B) * Float64(-1.0 / F)))
                                            end
                                            
                                            function tmp = code(F, B, x)
                                            	tmp = -(x / B) + ((F / B) * (-1.0 / F));
                                            end
                                            
                                            code[F_, B_, x_] := N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(-1 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                            
                                            \left(-\frac{x}{B}\right) + \frac{F}{B} \cdot \frac{-1}{F}
                                            
                                            Derivation
                                            1. Initial program 76.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. Taylor expanded in B around 0

                                              \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f6449.2%

                                                \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            4. Applied rewrites49.2%

                                              \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            5. Taylor expanded in F around -inf

                                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{-1}{F}} \]
                                            6. Step-by-step derivation
                                              1. lower-/.f6427.9%

                                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{-1}{\color{blue}{F}} \]
                                            7. Applied rewrites27.9%

                                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{-1}{F}} \]
                                            8. Taylor expanded in B around 0

                                              \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F} \]
                                            9. Step-by-step derivation
                                              1. lower-/.f6421.3%

                                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\color{blue}{B}} \cdot \frac{-1}{F} \]
                                            10. Applied rewrites21.3%

                                              \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F} \]
                                            11. Add Preprocessing

                                            Reproduce

                                            ?
                                            herbie shell --seed 2025285 -o generate:evaluate
                                            (FPCore (F B x)
                                              :name "VandenBroeck and Keller, Equation (23)"
                                              :precision binary64
                                              (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))