VandenBroeck and Keller, Equation (23)

Percentage Accurate: 75.8% → 98.8%
Time: 8.6s
Alternatives: 24
Speedup: 1.6×

Specification

?
\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
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.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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: 75.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
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.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 98.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 46.2%

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan 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 rewrites46.2%

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan 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 \cdot 1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B} \]
    7. Applied rewrites99.9%

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

    if -4.3000000000000002e40 < F < 2.6e-18

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan 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 rewrites99.7%

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

    if 2.6e-18 < F

    1. Initial program 56.0%

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

        \[\leadsto \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. lift-sin.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \]
      11. associate-*l/N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
      12. lower-/.f64N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
    4. Applied rewrites71.4%

      \[\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)}^{-0.5}}{\sin B}} \]
    5. Taylor expanded in F around inf

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
    6. Step-by-step derivation
      1. Applied rewrites99.8%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.3 \cdot 10^{+40}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-18}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 2: 98.7% accurate, 1.3× speedup?

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

      1. Initial program 46.2%

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

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

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

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

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

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

          \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan 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 rewrites46.2%

        \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan 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 \cdot 1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

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

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B} \]
      7. Applied rewrites99.9%

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

      if -4.3000000000000002e40 < F < 2.6e-18

      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \cdot \frac{F}{\sin B} \]
        15. lift-/.f6499.5

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

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

      if 2.6e-18 < F

      1. Initial program 56.0%

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

          \[\leadsto \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. lift-sin.f64N/A

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \]
        11. associate-*l/N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
        12. lower-/.f64N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
      4. Applied rewrites71.4%

        \[\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)}^{-0.5}}{\sin B}} \]
      5. Taylor expanded in F around inf

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
      6. Step-by-step derivation
        1. Applied rewrites99.8%

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

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

      Alternative 3: 98.7% accurate, 1.3× speedup?

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

        1. Initial program 44.0%

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

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

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

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

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

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

            \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan 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 rewrites44.0%

          \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan 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 \cdot 1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
        6. Step-by-step derivation
          1. lower-/.f64N/A

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

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B} \]
        7. Applied rewrites99.8%

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

        if -3.30000000000000013e44 < F < 2.6e-18

        1. Initial program 99.5%

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

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

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

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

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

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

            \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan 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 rewrites99.7%

          \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan 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 inf

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2.6e-18 < F

        1. Initial program 56.0%

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

            \[\leadsto \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. lift-sin.f64N/A

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \]
          11. associate-*l/N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
          12. lower-/.f64N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
        4. Applied rewrites71.4%

          \[\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)}^{-0.5}}{\sin B}} \]
        5. Taylor expanded in F around inf

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
        6. Step-by-step derivation
          1. Applied rewrites99.8%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{+44}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-18}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{\frac{F}{\sin B}}{\sqrt{\left(F \cdot F + 2\right) - -2 \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
        9. Add Preprocessing

        Alternative 4: 91.5% accurate, 1.4× speedup?

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

          1. Initial program 51.9%

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

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

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

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

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

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

              \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan 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 rewrites51.9%

            \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan 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 \cdot 1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
          6. Step-by-step derivation
            1. lower-/.f64N/A

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

              \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B} \]
          7. Applied rewrites99.8%

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

          if -8e13 < F < 4.99999999999999954e-22

          1. Initial program 99.5%

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

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

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

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

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

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

              \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan 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 rewrites99.7%

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

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

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

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

          if 4.99999999999999954e-22 < F

          1. Initial program 56.7%

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

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \]
            11. associate-*l/N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
            12. lower-/.f64N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
          4. Applied rewrites71.8%

            \[\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)}^{-0.5}}{\sin B}} \]
          5. Taylor expanded in F around inf

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

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

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

          Alternative 5: 91.4% accurate, 1.5× speedup?

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

            1. Initial program 51.9%

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

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

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

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

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

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

                \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan 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 rewrites51.9%

              \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan 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 \cdot 1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

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

                \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B} \]
            7. Applied rewrites99.8%

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

            if -8e13 < F < 4.99999999999999954e-22

            1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
              13. lift-*.f6484.3

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
            5. Applied rewrites84.3%

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

            if 4.99999999999999954e-22 < F

            1. Initial program 56.7%

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

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

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

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

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

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

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \]
              11. associate-*l/N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
              12. lower-/.f64N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
            4. Applied rewrites71.8%

              \[\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)}^{-0.5}}{\sin B}} \]
            5. Taylor expanded in F around inf

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

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

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

            Alternative 6: 91.4% accurate, 1.5× speedup?

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

              1. Initial program 51.9%

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
              5. Applied rewrites99.8%

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

              if -8e13 < F < 4.99999999999999954e-22

              1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                13. lift-*.f6484.3

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
              5. Applied rewrites84.3%

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

              if 4.99999999999999954e-22 < F

              1. Initial program 56.7%

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \]
                11. associate-*l/N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
                12. lower-/.f64N/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(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
              4. Applied rewrites71.8%

                \[\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)}^{-0.5}}{\sin B}} \]
              5. Taylor expanded in F around inf

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

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

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

              Alternative 7: 91.4% accurate, 1.6× speedup?

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

                1. Initial program 51.9%

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

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                5. Applied rewrites99.8%

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

                if -8e13 < F < 4.99999999999999954e-22

                1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                  13. lift-*.f6484.3

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                5. Applied rewrites84.3%

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

                if 4.99999999999999954e-22 < F

                1. Initial program 56.7%

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

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

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

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

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

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

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

                    \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                  7. lift-sin.f6498.3

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

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

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

              Alternative 8: 91.4% accurate, 1.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos B \cdot x\\ \mathbf{if}\;F \leq -80000000000000:\\ \;\;\;\;\frac{-1 - t\_0}{\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-22}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (let* ((t_0 (* (cos B) x)))
                 (if (<= F -80000000000000.0)
                   (/ (- -1.0 t_0) (sin B))
                   (if (<= F 5e-22)
                     (+
                      (* x (/ -1.0 (tan B)))
                      (* (/ F B) (/ 1.0 (sqrt (+ (+ (* 2.0 x) 2.0) (* F F))))))
                     (/ (- 1.0 t_0) (sin B))))))
              double code(double F, double B, double x) {
              	double t_0 = cos(B) * x;
              	double tmp;
              	if (F <= -80000000000000.0) {
              		tmp = (-1.0 - t_0) / sin(B);
              	} else if (F <= 5e-22) {
              		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((((2.0 * x) + 2.0) + (F * 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) :: tmp
                  t_0 = cos(b) * x
                  if (f <= (-80000000000000.0d0)) then
                      tmp = ((-1.0d0) - t_0) / sin(b)
                  else if (f <= 5d-22) then
                      tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * (1.0d0 / sqrt((((2.0d0 * x) + 2.0d0) + (f * 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 tmp;
              	if (F <= -80000000000000.0) {
              		tmp = (-1.0 - t_0) / Math.sin(B);
              	} else if (F <= 5e-22) {
              		tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * (1.0 / Math.sqrt((((2.0 * x) + 2.0) + (F * F)))));
              	} 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 <= -80000000000000.0:
              		tmp = (-1.0 - t_0) / math.sin(B)
              	elif F <= 5e-22:
              		tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * (1.0 / math.sqrt((((2.0 * x) + 2.0) + (F * F)))))
              	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 <= -80000000000000.0)
              		tmp = Float64(Float64(-1.0 - t_0) / sin(B));
              	elseif (F <= 5e-22)
              		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(Float64(Float64(2.0 * x) + 2.0) + Float64(F * 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;
              	tmp = 0.0;
              	if (F <= -80000000000000.0)
              		tmp = (-1.0 - t_0) / sin(B);
              	elseif (F <= 5e-22)
              		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((((2.0 * x) + 2.0) + (F * 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]}, If[LessEqual[F, -80000000000000.0], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-22], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(N[(N[(2.0 * x), $MachinePrecision] + 2.0), $MachinePrecision] + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \cos B \cdot x\\
              \mathbf{if}\;F \leq -80000000000000:\\
              \;\;\;\;\frac{-1 - t\_0}{\sin B}\\
              
              \mathbf{elif}\;F \leq 5 \cdot 10^{-22}:\\
              \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{1 - t\_0}{\sin B}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if F < -8e13

                1. Initial program 51.9%

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

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

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

                    \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                  3. div-add-revN/A

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

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

                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                  6. *-commutativeN/A

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

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

                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  9. lift-sin.f6499.8

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

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

                if -8e13 < F < 4.99999999999999954e-22

                1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                  13. lift-*.f6484.3

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                5. Applied rewrites84.3%

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

                if 4.99999999999999954e-22 < F

                1. Initial program 56.7%

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

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

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

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

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

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

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

                    \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                  7. lift-sin.f6498.3

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

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

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

              Alternative 9: 85.8% accurate, 1.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -80000000000000:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-22}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (if (<= F -80000000000000.0)
                 (/ (- -1.0 x) (sin B))
                 (if (<= F 5e-22)
                   (+
                    (* x (/ -1.0 (tan B)))
                    (* (/ F B) (/ 1.0 (sqrt (+ (+ (* 2.0 x) 2.0) (* F F))))))
                   (/ (- 1.0 (* (cos B) x)) (sin B)))))
              double code(double F, double B, double x) {
              	double tmp;
              	if (F <= -80000000000000.0) {
              		tmp = (-1.0 - x) / sin(B);
              	} else if (F <= 5e-22) {
              		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((((2.0 * x) + 2.0) + (F * F)))));
              	} 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 <= (-80000000000000.0d0)) then
                      tmp = ((-1.0d0) - x) / sin(b)
                  else if (f <= 5d-22) then
                      tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * (1.0d0 / sqrt((((2.0d0 * x) + 2.0d0) + (f * f)))))
                  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 <= -80000000000000.0) {
              		tmp = (-1.0 - x) / Math.sin(B);
              	} else if (F <= 5e-22) {
              		tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * (1.0 / Math.sqrt((((2.0 * x) + 2.0) + (F * F)))));
              	} else {
              		tmp = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
              	}
              	return tmp;
              }
              
              def code(F, B, x):
              	tmp = 0
              	if F <= -80000000000000.0:
              		tmp = (-1.0 - x) / math.sin(B)
              	elif F <= 5e-22:
              		tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * (1.0 / math.sqrt((((2.0 * x) + 2.0) + (F * F)))))
              	else:
              		tmp = (1.0 - (math.cos(B) * x)) / math.sin(B)
              	return tmp
              
              function code(F, B, x)
              	tmp = 0.0
              	if (F <= -80000000000000.0)
              		tmp = Float64(Float64(-1.0 - x) / sin(B));
              	elseif (F <= 5e-22)
              		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(Float64(Float64(2.0 * x) + 2.0) + Float64(F * F))))));
              	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 <= -80000000000000.0)
              		tmp = (-1.0 - x) / sin(B);
              	elseif (F <= 5e-22)
              		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((((2.0 * x) + 2.0) + (F * F)))));
              	else
              		tmp = (1.0 - (cos(B) * x)) / sin(B);
              	end
              	tmp_2 = tmp;
              end
              
              code[F_, B_, x_] := If[LessEqual[F, -80000000000000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-22], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(N[(N[(2.0 * x), $MachinePrecision] + 2.0), $MachinePrecision] + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;F \leq -80000000000000:\\
              \;\;\;\;\frac{-1 - x}{\sin B}\\
              
              \mathbf{elif}\;F \leq 5 \cdot 10^{-22}:\\
              \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if F < -8e13

                1. Initial program 51.9%

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

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

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

                    \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                  3. div-add-revN/A

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

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

                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                  6. *-commutativeN/A

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

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

                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  9. lift-sin.f6499.8

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

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

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

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

                  if -8e13 < F < 4.99999999999999954e-22

                  1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                    13. lift-*.f6484.3

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                  5. Applied rewrites84.3%

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

                  if 4.99999999999999954e-22 < F

                  1. Initial program 56.7%

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

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

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

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

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

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

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

                      \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                    7. lift-sin.f6498.3

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

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

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

                Alternative 10: 79.0% accurate, 1.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -80000000000000:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-7}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + {\sin B}^{-1}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (if (<= F -80000000000000.0)
                   (/ (- -1.0 x) (sin B))
                   (if (<= F 1.6e-7)
                     (+
                      (* x (/ -1.0 (tan B)))
                      (* (/ F B) (/ 1.0 (sqrt (+ (+ (* 2.0 x) 2.0) (* F F))))))
                     (+ (- (/ x B)) (pow (sin B) -1.0)))))
                double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -80000000000000.0) {
                		tmp = (-1.0 - x) / sin(B);
                	} else if (F <= 1.6e-7) {
                		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((((2.0 * x) + 2.0) + (F * F)))));
                	} else {
                		tmp = -(x / B) + pow(sin(B), -1.0);
                	}
                	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 <= (-80000000000000.0d0)) then
                        tmp = ((-1.0d0) - x) / sin(b)
                    else if (f <= 1.6d-7) then
                        tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * (1.0d0 / sqrt((((2.0d0 * x) + 2.0d0) + (f * f)))))
                    else
                        tmp = -(x / b) + (sin(b) ** (-1.0d0))
                    end if
                    code = tmp
                end function
                
                public static double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -80000000000000.0) {
                		tmp = (-1.0 - x) / Math.sin(B);
                	} else if (F <= 1.6e-7) {
                		tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * (1.0 / Math.sqrt((((2.0 * x) + 2.0) + (F * F)))));
                	} else {
                		tmp = -(x / B) + Math.pow(Math.sin(B), -1.0);
                	}
                	return tmp;
                }
                
                def code(F, B, x):
                	tmp = 0
                	if F <= -80000000000000.0:
                		tmp = (-1.0 - x) / math.sin(B)
                	elif F <= 1.6e-7:
                		tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * (1.0 / math.sqrt((((2.0 * x) + 2.0) + (F * F)))))
                	else:
                		tmp = -(x / B) + math.pow(math.sin(B), -1.0)
                	return tmp
                
                function code(F, B, x)
                	tmp = 0.0
                	if (F <= -80000000000000.0)
                		tmp = Float64(Float64(-1.0 - x) / sin(B));
                	elseif (F <= 1.6e-7)
                		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(Float64(Float64(2.0 * x) + 2.0) + Float64(F * F))))));
                	else
                		tmp = Float64(Float64(-Float64(x / B)) + (sin(B) ^ -1.0));
                	end
                	return tmp
                end
                
                function tmp_2 = code(F, B, x)
                	tmp = 0.0;
                	if (F <= -80000000000000.0)
                		tmp = (-1.0 - x) / sin(B);
                	elseif (F <= 1.6e-7)
                		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((((2.0 * x) + 2.0) + (F * F)))));
                	else
                		tmp = -(x / B) + (sin(B) ^ -1.0);
                	end
                	tmp_2 = tmp;
                end
                
                code[F_, B_, x_] := If[LessEqual[F, -80000000000000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e-7], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(N[(N[(2.0 * x), $MachinePrecision] + 2.0), $MachinePrecision] + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;F \leq -80000000000000:\\
                \;\;\;\;\frac{-1 - x}{\sin B}\\
                
                \mathbf{elif}\;F \leq 1.6 \cdot 10^{-7}:\\
                \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(-\frac{x}{B}\right) + {\sin B}^{-1}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if F < -8e13

                  1. Initial program 51.9%

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

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

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

                      \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                    3. div-add-revN/A

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

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

                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    6. *-commutativeN/A

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

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

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    9. lift-sin.f6499.8

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

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

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

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

                    if -8e13 < F < 1.6e-7

                    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                      13. lift-*.f6484.0

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                    5. Applied rewrites84.0%

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

                    if 1.6e-7 < F

                    1. Initial program 53.9%

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

                      \[\leadsto \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)} \]
                    4. Step-by-step derivation
                      1. lower-/.f6431.1

                        \[\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)} \]
                    5. Applied rewrites31.1%

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

                      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
                    7. Step-by-step derivation
                      1. inv-powN/A

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

                        \[\leadsto \left(-\frac{x}{B}\right) + {\sin B}^{\color{blue}{-1}} \]
                      3. lift-sin.f6476.7

                        \[\leadsto \left(-\frac{x}{B}\right) + {\sin B}^{-1} \]
                    8. Applied rewrites76.7%

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

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

                  Alternative 11: 73.4% accurate, 1.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{x}{B}\\ \mathbf{if}\;F \leq -80000000000000:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-98}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{+222}:\\ \;\;\;\;t\_0 + \frac{F}{\sin B \cdot \sqrt{\left(F \cdot F + 2\right) - -2 \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}}{F}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (let* ((t_0 (- (/ x B))))
                     (if (<= F -80000000000000.0)
                       (/ (- -1.0 x) (sin B))
                       (if (<= F 7.5e-98)
                         (+
                          (* x (/ -1.0 (tan B)))
                          (* (/ F B) (/ 1.0 (sqrt (+ (+ (* 2.0 x) 2.0) (* F F))))))
                         (if (<= F 4.5e+222)
                           (+ t_0 (/ F (* (sin B) (sqrt (- (+ (* F F) 2.0) (* -2.0 x))))))
                           (+
                            t_0
                            (*
                             (/ F (sin B))
                             (/ (+ 1.0 (* -0.5 (/ (+ 2.0 (* 2.0 x)) (* F F)))) F))))))))
                  double code(double F, double B, double x) {
                  	double t_0 = -(x / B);
                  	double tmp;
                  	if (F <= -80000000000000.0) {
                  		tmp = (-1.0 - x) / sin(B);
                  	} else if (F <= 7.5e-98) {
                  		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((((2.0 * x) + 2.0) + (F * F)))));
                  	} else if (F <= 4.5e+222) {
                  		tmp = t_0 + (F / (sin(B) * sqrt((((F * F) + 2.0) - (-2.0 * x)))));
                  	} else {
                  		tmp = t_0 + ((F / sin(B)) * ((1.0 + (-0.5 * ((2.0 + (2.0 * x)) / (F * F)))) / F));
                  	}
                  	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 <= (-80000000000000.0d0)) then
                          tmp = ((-1.0d0) - x) / sin(b)
                      else if (f <= 7.5d-98) then
                          tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * (1.0d0 / sqrt((((2.0d0 * x) + 2.0d0) + (f * f)))))
                      else if (f <= 4.5d+222) then
                          tmp = t_0 + (f / (sin(b) * sqrt((((f * f) + 2.0d0) - ((-2.0d0) * x)))))
                      else
                          tmp = t_0 + ((f / sin(b)) * ((1.0d0 + ((-0.5d0) * ((2.0d0 + (2.0d0 * x)) / (f * f)))) / f))
                      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 <= -80000000000000.0) {
                  		tmp = (-1.0 - x) / Math.sin(B);
                  	} else if (F <= 7.5e-98) {
                  		tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * (1.0 / Math.sqrt((((2.0 * x) + 2.0) + (F * F)))));
                  	} else if (F <= 4.5e+222) {
                  		tmp = t_0 + (F / (Math.sin(B) * Math.sqrt((((F * F) + 2.0) - (-2.0 * x)))));
                  	} else {
                  		tmp = t_0 + ((F / Math.sin(B)) * ((1.0 + (-0.5 * ((2.0 + (2.0 * x)) / (F * F)))) / F));
                  	}
                  	return tmp;
                  }
                  
                  def code(F, B, x):
                  	t_0 = -(x / B)
                  	tmp = 0
                  	if F <= -80000000000000.0:
                  		tmp = (-1.0 - x) / math.sin(B)
                  	elif F <= 7.5e-98:
                  		tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * (1.0 / math.sqrt((((2.0 * x) + 2.0) + (F * F)))))
                  	elif F <= 4.5e+222:
                  		tmp = t_0 + (F / (math.sin(B) * math.sqrt((((F * F) + 2.0) - (-2.0 * x)))))
                  	else:
                  		tmp = t_0 + ((F / math.sin(B)) * ((1.0 + (-0.5 * ((2.0 + (2.0 * x)) / (F * F)))) / F))
                  	return tmp
                  
                  function code(F, B, x)
                  	t_0 = Float64(-Float64(x / B))
                  	tmp = 0.0
                  	if (F <= -80000000000000.0)
                  		tmp = Float64(Float64(-1.0 - x) / sin(B));
                  	elseif (F <= 7.5e-98)
                  		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(Float64(Float64(2.0 * x) + 2.0) + Float64(F * F))))));
                  	elseif (F <= 4.5e+222)
                  		tmp = Float64(t_0 + Float64(F / Float64(sin(B) * sqrt(Float64(Float64(Float64(F * F) + 2.0) - Float64(-2.0 * x))))));
                  	else
                  		tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / Float64(F * F)))) / F)));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(F, B, x)
                  	t_0 = -(x / B);
                  	tmp = 0.0;
                  	if (F <= -80000000000000.0)
                  		tmp = (-1.0 - x) / sin(B);
                  	elseif (F <= 7.5e-98)
                  		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((((2.0 * x) + 2.0) + (F * F)))));
                  	elseif (F <= 4.5e+222)
                  		tmp = t_0 + (F / (sin(B) * sqrt((((F * F) + 2.0) - (-2.0 * x)))));
                  	else
                  		tmp = t_0 + ((F / sin(B)) * ((1.0 + (-0.5 * ((2.0 + (2.0 * x)) / (F * F)))) / F));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -80000000000000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-98], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(N[(N[(2.0 * x), $MachinePrecision] + 2.0), $MachinePrecision] + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e+222], N[(t$95$0 + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] - N[(-2.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(-0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := -\frac{x}{B}\\
                  \mathbf{if}\;F \leq -80000000000000:\\
                  \;\;\;\;\frac{-1 - x}{\sin B}\\
                  
                  \mathbf{elif}\;F \leq 7.5 \cdot 10^{-98}:\\
                  \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\
                  
                  \mathbf{elif}\;F \leq 4.5 \cdot 10^{+222}:\\
                  \;\;\;\;t\_0 + \frac{F}{\sin B \cdot \sqrt{\left(F \cdot F + 2\right) - -2 \cdot x}}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}}{F}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if F < -8e13

                    1. Initial program 51.9%

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

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

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

                        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                      3. div-add-revN/A

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

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

                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                      6. *-commutativeN/A

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

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

                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                      9. lift-sin.f6499.8

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

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

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

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

                      if -8e13 < F < 7.5000000000000006e-98

                      1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                        13. lift-*.f6485.7

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

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

                      if 7.5000000000000006e-98 < F < 4.49999999999999989e222

                      1. Initial program 74.9%

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

                        \[\leadsto \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)} \]
                      4. Step-by-step derivation
                        1. lower-/.f6454.9

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                        11. pow2N/A

                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                        12. lift-*.f6454.9

                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                      8. Applied rewrites54.9%

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                        10. frac-timesN/A

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

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

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

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

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

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

                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot 1}{\sin B \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                      10. Applied rewrites72.5%

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

                      if 4.49999999999999989e222 < F

                      1. Initial program 27.1%

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

                        \[\leadsto \left(-\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)} \]
                      4. Step-by-step derivation
                        1. lower-/.f642.6

                          \[\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)} \]
                      5. Applied rewrites2.6%

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F}}{F} \]
                        8. lift-*.f6460.7

                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}}{F} \]
                      8. Applied rewrites60.7%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -80000000000000:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-98}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{+222}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{\left(F \cdot F + 2\right) - -2 \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}}{F}\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 12: 72.8% accurate, 1.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -80000000000000:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-98} \lor \neg \left(F \leq 1.5 \cdot 10^{+196}\right):\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{\left(F \cdot F + 2\right) - -2 \cdot x}}\\ \end{array} \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (if (<= F -80000000000000.0)
                       (/ (- -1.0 x) (sin B))
                       (if (or (<= F 7.5e-98) (not (<= F 1.5e+196)))
                         (+
                          (* x (/ -1.0 (tan B)))
                          (* (/ F B) (/ 1.0 (sqrt (+ (+ (* 2.0 x) 2.0) (* F F))))))
                         (+ (- (/ x B)) (/ F (* (sin B) (sqrt (- (+ (* F F) 2.0) (* -2.0 x)))))))))
                    double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -80000000000000.0) {
                    		tmp = (-1.0 - x) / sin(B);
                    	} else if ((F <= 7.5e-98) || !(F <= 1.5e+196)) {
                    		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((((2.0 * x) + 2.0) + (F * F)))));
                    	} else {
                    		tmp = -(x / B) + (F / (sin(B) * sqrt((((F * F) + 2.0) - (-2.0 * x)))));
                    	}
                    	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 <= (-80000000000000.0d0)) then
                            tmp = ((-1.0d0) - x) / sin(b)
                        else if ((f <= 7.5d-98) .or. (.not. (f <= 1.5d+196))) then
                            tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * (1.0d0 / sqrt((((2.0d0 * x) + 2.0d0) + (f * f)))))
                        else
                            tmp = -(x / b) + (f / (sin(b) * sqrt((((f * f) + 2.0d0) - ((-2.0d0) * x)))))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -80000000000000.0) {
                    		tmp = (-1.0 - x) / Math.sin(B);
                    	} else if ((F <= 7.5e-98) || !(F <= 1.5e+196)) {
                    		tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * (1.0 / Math.sqrt((((2.0 * x) + 2.0) + (F * F)))));
                    	} else {
                    		tmp = -(x / B) + (F / (Math.sin(B) * Math.sqrt((((F * F) + 2.0) - (-2.0 * x)))));
                    	}
                    	return tmp;
                    }
                    
                    def code(F, B, x):
                    	tmp = 0
                    	if F <= -80000000000000.0:
                    		tmp = (-1.0 - x) / math.sin(B)
                    	elif (F <= 7.5e-98) or not (F <= 1.5e+196):
                    		tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * (1.0 / math.sqrt((((2.0 * x) + 2.0) + (F * F)))))
                    	else:
                    		tmp = -(x / B) + (F / (math.sin(B) * math.sqrt((((F * F) + 2.0) - (-2.0 * x)))))
                    	return tmp
                    
                    function code(F, B, x)
                    	tmp = 0.0
                    	if (F <= -80000000000000.0)
                    		tmp = Float64(Float64(-1.0 - x) / sin(B));
                    	elseif ((F <= 7.5e-98) || !(F <= 1.5e+196))
                    		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(Float64(Float64(2.0 * x) + 2.0) + Float64(F * F))))));
                    	else
                    		tmp = Float64(Float64(-Float64(x / B)) + Float64(F / Float64(sin(B) * sqrt(Float64(Float64(Float64(F * F) + 2.0) - Float64(-2.0 * x))))));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(F, B, x)
                    	tmp = 0.0;
                    	if (F <= -80000000000000.0)
                    		tmp = (-1.0 - x) / sin(B);
                    	elseif ((F <= 7.5e-98) || ~((F <= 1.5e+196)))
                    		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((((2.0 * x) + 2.0) + (F * F)))));
                    	else
                    		tmp = -(x / B) + (F / (sin(B) * sqrt((((F * F) + 2.0) - (-2.0 * x)))));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[F_, B_, x_] := If[LessEqual[F, -80000000000000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 7.5e-98], N[Not[LessEqual[F, 1.5e+196]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(N[(N[(2.0 * x), $MachinePrecision] + 2.0), $MachinePrecision] + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] - N[(-2.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;F \leq -80000000000000:\\
                    \;\;\;\;\frac{-1 - x}{\sin B}\\
                    
                    \mathbf{elif}\;F \leq 7.5 \cdot 10^{-98} \lor \neg \left(F \leq 1.5 \cdot 10^{+196}\right):\\
                    \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{\left(F \cdot F + 2\right) - -2 \cdot x}}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if F < -8e13

                      1. Initial program 51.9%

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

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

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

                          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                        3. div-add-revN/A

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

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

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        6. *-commutativeN/A

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

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

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        9. lift-sin.f6499.8

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

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

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

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

                        if -8e13 < F < 7.5000000000000006e-98 or 1.4999999999999999e196 < F

                        1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                          13. lift-*.f6474.2

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}} \]
                        5. Applied rewrites74.2%

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

                        if 7.5000000000000006e-98 < F < 1.4999999999999999e196

                        1. Initial program 78.2%

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

                            \[\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)} \]
                        5. Applied rewrites61.1%

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                          11. pow2N/A

                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                          12. lift-*.f6461.2

                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                        8. Applied rewrites61.2%

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                          10. frac-timesN/A

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

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

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

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

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

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

                            \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot 1}{\sin B \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                        10. Applied rewrites78.8%

                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot 1}{\color{blue}{\sin B \cdot \sqrt{\left(F \cdot F + 2\right) - -2 \cdot x}}} \]
                      8. Recombined 3 regimes into one program.
                      9. Final simplification78.5%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -80000000000000:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-98} \lor \neg \left(F \leq 1.5 \cdot 10^{+196}\right):\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{\left(2 \cdot x + 2\right) + F \cdot F}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{\left(F \cdot F + 2\right) - -2 \cdot x}}\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 13: 67.4% accurate, 2.1× speedup?

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

                        1. Initial program 48.9%

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

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

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

                            \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                          3. div-add-revN/A

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

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

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          6. *-commutativeN/A

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

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

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          9. lift-sin.f6499.8

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

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

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

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

                          if -1.9e35 < F < 2.9999999999999999e116

                          1. Initial program 96.8%

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

                            \[\leadsto \left(-\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)} \]
                          4. Step-by-step derivation
                            1. lower-/.f6467.0

                              \[\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)} \]
                          5. Applied rewrites67.0%

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                            11. pow2N/A

                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                            12. lift-*.f6467.0

                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                          8. Applied rewrites67.0%

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

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

                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + F \cdot F}} \]
                            2. lift-*.f6467.0

                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + F \cdot F}} \]
                          11. Applied rewrites67.0%

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

                          if 2.9999999999999999e116 < F

                          1. Initial program 31.6%

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
                            7. lift-*.f6435.5

                              \[\leadsto \frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
                          8. Applied rewrites35.5%

                            \[\leadsto \frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B} \]
                        8. Recombined 3 regimes into one program.
                        9. Final simplification67.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.9 \cdot 10^{+35}:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{+116}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + F \cdot F}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + -0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F}\right) - x}{B}\\ \end{array} \]
                        10. Add Preprocessing

                        Alternative 14: 65.0% accurate, 2.2× speedup?

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

                          1. Initial program 48.9%

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

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

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

                              \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                            3. div-add-revN/A

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

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

                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                            6. *-commutativeN/A

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

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

                              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                            9. lift-sin.f6499.8

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

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

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

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

                            if -3.19999999999999983e35 < F

                            1. Initial program 83.5%

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

                              \[\leadsto \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)} \]
                            4. Step-by-step derivation
                              1. lower-/.f6455.0

                                \[\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)} \]
                            5. Applied rewrites55.0%

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                              11. pow2N/A

                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                              12. lift-*.f6455.0

                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                            8. Applied rewrites55.0%

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

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

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

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

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

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

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

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

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

                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                              10. frac-timesN/A

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

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

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

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

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

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

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

                              \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot 1}{\color{blue}{\sin B \cdot \sqrt{\left(F \cdot F + 2\right) - -2 \cdot x}}} \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification67.8%

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

                          Alternative 15: 65.1% accurate, 2.3× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.26:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-12}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{2 \cdot x + 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                          (FPCore (F B x)
                           :precision binary64
                           (if (<= F -1.26)
                             (/ (- -1.0 x) (sin B))
                             (if (<= F 6.8e-12)
                               (+ (- (/ x B)) (/ F (* (sin B) (sqrt (+ (* 2.0 x) 2.0)))))
                               (/ (- 1.0 x) B))))
                          double code(double F, double B, double x) {
                          	double tmp;
                          	if (F <= -1.26) {
                          		tmp = (-1.0 - x) / sin(B);
                          	} else if (F <= 6.8e-12) {
                          		tmp = -(x / B) + (F / (sin(B) * sqrt(((2.0 * x) + 2.0))));
                          	} else {
                          		tmp = (1.0 - x) / 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.26d0)) then
                                  tmp = ((-1.0d0) - x) / sin(b)
                              else if (f <= 6.8d-12) then
                                  tmp = -(x / b) + (f / (sin(b) * sqrt(((2.0d0 * x) + 2.0d0))))
                              else
                                  tmp = (1.0d0 - x) / b
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double F, double B, double x) {
                          	double tmp;
                          	if (F <= -1.26) {
                          		tmp = (-1.0 - x) / Math.sin(B);
                          	} else if (F <= 6.8e-12) {
                          		tmp = -(x / B) + (F / (Math.sin(B) * Math.sqrt(((2.0 * x) + 2.0))));
                          	} else {
                          		tmp = (1.0 - x) / B;
                          	}
                          	return tmp;
                          }
                          
                          def code(F, B, x):
                          	tmp = 0
                          	if F <= -1.26:
                          		tmp = (-1.0 - x) / math.sin(B)
                          	elif F <= 6.8e-12:
                          		tmp = -(x / B) + (F / (math.sin(B) * math.sqrt(((2.0 * x) + 2.0))))
                          	else:
                          		tmp = (1.0 - x) / B
                          	return tmp
                          
                          function code(F, B, x)
                          	tmp = 0.0
                          	if (F <= -1.26)
                          		tmp = Float64(Float64(-1.0 - x) / sin(B));
                          	elseif (F <= 6.8e-12)
                          		tmp = Float64(Float64(-Float64(x / B)) + Float64(F / Float64(sin(B) * sqrt(Float64(Float64(2.0 * x) + 2.0)))));
                          	else
                          		tmp = Float64(Float64(1.0 - x) / B);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(F, B, x)
                          	tmp = 0.0;
                          	if (F <= -1.26)
                          		tmp = (-1.0 - x) / sin(B);
                          	elseif (F <= 6.8e-12)
                          		tmp = -(x / B) + (F / (sin(B) * sqrt(((2.0 * x) + 2.0))));
                          	else
                          		tmp = (1.0 - x) / B;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[F_, B_, x_] := If[LessEqual[F, -1.26], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.8e-12], N[((-N[(x / B), $MachinePrecision]) + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(N[(2.0 * x), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;F \leq -1.26:\\
                          \;\;\;\;\frac{-1 - x}{\sin B}\\
                          
                          \mathbf{elif}\;F \leq 6.8 \cdot 10^{-12}:\\
                          \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B \cdot \sqrt{2 \cdot x + 2}}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{1 - x}{B}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if F < -1.26000000000000001

                            1. Initial program 53.0%

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

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

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

                                \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                              3. div-add-revN/A

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

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

                                \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                              6. *-commutativeN/A

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

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

                                \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                              9. lift-sin.f6499.2

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

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

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

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

                              if -1.26000000000000001 < F < 6.8000000000000001e-12

                              1. Initial program 99.5%

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

                                \[\leadsto \left(-\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)} \]
                              4. Step-by-step derivation
                                1. lower-/.f6466.5

                                  \[\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)} \]
                              5. Applied rewrites66.5%

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                                11. pow2N/A

                                  \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                                12. lift-*.f6466.4

                                  \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                              8. Applied rewrites66.4%

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

                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + 2 \cdot x}} \]
                              10. Step-by-step derivation
                                1. lift-*.f6466.4

                                  \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + 2 \cdot x}} \]
                              11. Applied rewrites66.4%

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot 1}{\sin B \cdot \sqrt{2 \cdot x + 2}} \]
                                12. lower-+.f6466.5

                                  \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot 1}{\sin B \cdot \sqrt{2 \cdot x + 2}} \]
                              13. Applied rewrites66.5%

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

                              if 6.8000000000000001e-12 < F

                              1. Initial program 54.6%

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

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

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

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

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

                                  \[\leadsto \frac{1 - x}{B} \]
                              8. Recombined 3 regimes into one program.
                              9. Final simplification67.2%

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

                              Alternative 16: 54.7% accurate, 3.0× speedup?

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

                                1. Initial program 51.9%

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

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

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

                                    \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                  3. div-add-revN/A

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

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

                                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                  6. *-commutativeN/A

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

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

                                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                  9. lift-sin.f6499.8

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

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

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

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

                                  if -8e13 < F

                                  1. Initial program 83.1%

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

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

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

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

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

                                      \[\leadsto \frac{\frac{1}{\sqrt{2 + F \cdot F}} \cdot F - x}{B} \]
                                  8. Recombined 2 regimes into one program.
                                  9. Final simplification59.4%

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

                                  Alternative 17: 48.1% accurate, 3.1× speedup?

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

                                    1. Initial program 51.9%

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

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

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

                                        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                      3. div-add-revN/A

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

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

                                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                      6. *-commutativeN/A

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

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

                                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                      9. lift-sin.f6499.8

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

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

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

                                        \[\leadsto \frac{-1}{\sin B} \]
                                      2. lift-sin.f6467.5

                                        \[\leadsto \frac{-1}{\sin B} \]
                                    8. Applied rewrites67.5%

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

                                    if -8e13 < F

                                    1. Initial program 83.1%

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

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

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

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

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

                                        \[\leadsto \frac{\frac{1}{\sqrt{2 + F \cdot F}} \cdot F - x}{B} \]
                                    8. Recombined 2 regimes into one program.
                                    9. Add Preprocessing

                                    Alternative 18: 47.3% accurate, 6.7× speedup?

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

                                      1. Initial program 50.1%

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

                                        \[\leadsto \left(-\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)} \]
                                      4. Step-by-step derivation
                                        1. lower-/.f6433.5

                                          \[\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)} \]
                                      5. Applied rewrites33.5%

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

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

                                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                                        2. lift-sin.f6483.4

                                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{\sin B} \]
                                      8. Applied rewrites83.4%

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

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

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

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

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

                                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{B \cdot \left(\frac{-1}{6} \cdot {B}^{2} + 1\right)} \]
                                        5. unpow2N/A

                                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{B \cdot \left(\frac{-1}{6} \cdot \left(B \cdot B\right) + 1\right)} \]
                                        6. lower-*.f6457.1

                                          \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{B \cdot \left(-0.16666666666666666 \cdot \left(B \cdot B\right) + 1\right)} \]
                                      11. Applied rewrites57.1%

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

                                      if -2.49999999999999986e33 < F

                                      1. Initial program 83.4%

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

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

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

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

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

                                          \[\leadsto \frac{\frac{1}{\sqrt{2 + F \cdot F}} \cdot F - x}{B} \]
                                      8. Recombined 2 regimes into one program.
                                      9. Add Preprocessing

                                      Alternative 19: 50.7% accurate, 6.9× speedup?

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

                                        1. Initial program 53.0%

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

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

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

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

                                          \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                        7. Step-by-step derivation
                                          1. metadata-evalN/A

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

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

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

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

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

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

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

                                            \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
                                          9. lift-*.f6456.0

                                            \[\leadsto \frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B} \]
                                        8. Applied rewrites56.0%

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

                                        if -1.8600000000000001 < F < 2.6e-18

                                        1. Initial program 99.5%

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

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

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

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

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

                                            \[\leadsto \frac{\frac{1}{\sqrt{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                          2. lift-*.f6451.0

                                            \[\leadsto \frac{\frac{1}{\sqrt{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                        8. Applied rewrites51.0%

                                          \[\leadsto \frac{\frac{1}{\sqrt{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                        9. Taylor expanded in x around 0

                                          \[\leadsto \frac{\frac{1}{\sqrt{2}} \cdot F - x}{B} \]
                                        10. Step-by-step derivation
                                          1. Applied rewrites51.0%

                                            \[\leadsto \frac{\frac{1}{\sqrt{2}} \cdot F - x}{B} \]

                                          if 2.6e-18 < F

                                          1. Initial program 56.0%

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

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

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

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

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

                                              \[\leadsto \frac{1 - x}{B} \]
                                          8. Recombined 3 regimes into one program.
                                          9. Final simplification51.2%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.86:\\ \;\;\;\;\frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-18}:\\ \;\;\;\;\frac{\frac{1}{\sqrt{2}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                          10. Add Preprocessing

                                          Alternative 20: 50.6% accurate, 6.9× speedup?

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

                                            1. Initial program 53.0%

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

                                              \[\leadsto \left(-\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)} \]
                                            4. Step-by-step derivation
                                              1. lower-/.f6437.4

                                                \[\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)} \]
                                            5. Applied rewrites37.4%

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

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

                                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                                              2. lift-sin.f6483.8

                                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{\sin B} \]
                                            8. Applied rewrites83.8%

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

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

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

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

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

                                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{B \cdot \left(\frac{-1}{6} \cdot {B}^{2} + 1\right)} \]
                                              5. unpow2N/A

                                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{B \cdot \left(\frac{-1}{6} \cdot \left(B \cdot B\right) + 1\right)} \]
                                              6. lower-*.f6455.7

                                                \[\leadsto \left(-\frac{x}{B}\right) + \frac{-1}{B \cdot \left(-0.16666666666666666 \cdot \left(B \cdot B\right) + 1\right)} \]
                                            11. Applied rewrites55.7%

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

                                            if -1.69999999999999996 < F < 2.6e-18

                                            1. Initial program 99.5%

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

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

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

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

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

                                                \[\leadsto \frac{\frac{1}{\sqrt{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                              2. lift-*.f6451.0

                                                \[\leadsto \frac{\frac{1}{\sqrt{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                            8. Applied rewrites51.0%

                                              \[\leadsto \frac{\frac{1}{\sqrt{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                            9. Taylor expanded in x around 0

                                              \[\leadsto \frac{\frac{1}{\sqrt{2}} \cdot F - x}{B} \]
                                            10. Step-by-step derivation
                                              1. Applied rewrites51.0%

                                                \[\leadsto \frac{\frac{1}{\sqrt{2}} \cdot F - x}{B} \]

                                              if 2.6e-18 < F

                                              1. Initial program 56.0%

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

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

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

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

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

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

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

                                              Alternative 21: 49.6% accurate, 6.9× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.55 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{-1 \cdot -1 - x \cdot x}{-1 + x}}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-18}:\\ \;\;\;\;\frac{\frac{1}{\sqrt{2}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                              (FPCore (F B x)
                                               :precision binary64
                                               (if (<= F -1.55e-13)
                                                 (/ (/ (- (* -1.0 -1.0) (* x x)) (+ -1.0 x)) B)
                                                 (if (<= F 2.6e-18) (/ (- (* (/ 1.0 (sqrt 2.0)) F) x) B) (/ (- 1.0 x) B))))
                                              double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= -1.55e-13) {
                                              		tmp = (((-1.0 * -1.0) - (x * x)) / (-1.0 + x)) / B;
                                              	} else if (F <= 2.6e-18) {
                                              		tmp = (((1.0 / sqrt(2.0)) * F) - x) / B;
                                              	} else {
                                              		tmp = (1.0 - x) / 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.55d-13)) then
                                                      tmp = ((((-1.0d0) * (-1.0d0)) - (x * x)) / ((-1.0d0) + x)) / b
                                                  else if (f <= 2.6d-18) then
                                                      tmp = (((1.0d0 / sqrt(2.0d0)) * f) - x) / b
                                                  else
                                                      tmp = (1.0d0 - x) / b
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= -1.55e-13) {
                                              		tmp = (((-1.0 * -1.0) - (x * x)) / (-1.0 + x)) / B;
                                              	} else if (F <= 2.6e-18) {
                                              		tmp = (((1.0 / Math.sqrt(2.0)) * F) - x) / B;
                                              	} else {
                                              		tmp = (1.0 - x) / B;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(F, B, x):
                                              	tmp = 0
                                              	if F <= -1.55e-13:
                                              		tmp = (((-1.0 * -1.0) - (x * x)) / (-1.0 + x)) / B
                                              	elif F <= 2.6e-18:
                                              		tmp = (((1.0 / math.sqrt(2.0)) * F) - x) / B
                                              	else:
                                              		tmp = (1.0 - x) / B
                                              	return tmp
                                              
                                              function code(F, B, x)
                                              	tmp = 0.0
                                              	if (F <= -1.55e-13)
                                              		tmp = Float64(Float64(Float64(Float64(-1.0 * -1.0) - Float64(x * x)) / Float64(-1.0 + x)) / B);
                                              	elseif (F <= 2.6e-18)
                                              		tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(2.0)) * F) - x) / B);
                                              	else
                                              		tmp = Float64(Float64(1.0 - x) / B);
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(F, B, x)
                                              	tmp = 0.0;
                                              	if (F <= -1.55e-13)
                                              		tmp = (((-1.0 * -1.0) - (x * x)) / (-1.0 + x)) / B;
                                              	elseif (F <= 2.6e-18)
                                              		tmp = (((1.0 / sqrt(2.0)) * F) - x) / B;
                                              	else
                                              		tmp = (1.0 - x) / B;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[F_, B_, x_] := If[LessEqual[F, -1.55e-13], N[(N[(N[(N[(-1.0 * -1.0), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.6e-18], N[(N[(N[(N[(1.0 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;F \leq -1.55 \cdot 10^{-13}:\\
                                              \;\;\;\;\frac{\frac{-1 \cdot -1 - x \cdot x}{-1 + x}}{B}\\
                                              
                                              \mathbf{elif}\;F \leq 2.6 \cdot 10^{-18}:\\
                                              \;\;\;\;\frac{\frac{1}{\sqrt{2}} \cdot F - x}{B}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{1 - x}{B}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 3 regimes
                                              2. if F < -1.55e-13

                                                1. Initial program 54.6%

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

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

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

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

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

                                                    \[\leadsto \frac{-1 - x}{B} \]
                                                  2. Step-by-step derivation
                                                    1. lift--.f64N/A

                                                      \[\leadsto \frac{-1 - x}{B} \]
                                                    2. flip--N/A

                                                      \[\leadsto \frac{\frac{-1 \cdot -1 - x \cdot x}{-1 + x}}{B} \]
                                                    3. lower-/.f64N/A

                                                      \[\leadsto \frac{\frac{-1 \cdot -1 - x \cdot x}{-1 + x}}{B} \]
                                                    4. lower--.f64N/A

                                                      \[\leadsto \frac{\frac{-1 \cdot -1 - x \cdot x}{-1 + x}}{B} \]
                                                    5. lower-*.f64N/A

                                                      \[\leadsto \frac{\frac{-1 \cdot -1 - x \cdot x}{-1 + x}}{B} \]
                                                    6. lower-*.f64N/A

                                                      \[\leadsto \frac{\frac{-1 \cdot -1 - x \cdot x}{-1 + x}}{B} \]
                                                    7. lower-+.f6455.1

                                                      \[\leadsto \frac{\frac{-1 \cdot -1 - x \cdot x}{-1 + x}}{B} \]
                                                  3. Applied rewrites55.1%

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

                                                  if -1.55e-13 < F < 2.6e-18

                                                  1. Initial program 99.5%

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

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

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

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

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

                                                      \[\leadsto \frac{\frac{1}{\sqrt{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                                    2. lift-*.f6451.4

                                                      \[\leadsto \frac{\frac{1}{\sqrt{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                                  8. Applied rewrites51.4%

                                                    \[\leadsto \frac{\frac{1}{\sqrt{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                                  9. Taylor expanded in x around 0

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

                                                      \[\leadsto \frac{\frac{1}{\sqrt{2}} \cdot F - x}{B} \]

                                                    if 2.6e-18 < F

                                                    1. Initial program 56.0%

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

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

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

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

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

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

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.55 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{-1 \cdot -1 - x \cdot x}{-1 + x}}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-18}:\\ \;\;\;\;\frac{\frac{1}{\sqrt{2}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                                    10. Add Preprocessing

                                                    Alternative 22: 42.6% accurate, 13.6× speedup?

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

                                                      1. Initial program 63.5%

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

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

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

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

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

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

                                                        if -3.90000000000000012e-168 < F < 3.3e-102

                                                        1. Initial program 99.6%

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

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

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

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

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

                                                            \[\leadsto \frac{-1 - x}{B} \]
                                                          2. Taylor expanded in F around 0

                                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                                          3. Step-by-step derivation
                                                            1. mul-1-negN/A

                                                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                            2. lower-neg.f6446.1

                                                              \[\leadsto \frac{-x}{B} \]
                                                          4. Applied rewrites46.1%

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

                                                          if 3.3e-102 < F

                                                          1. Initial program 62.8%

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

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

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

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

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

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

                                                          Alternative 23: 35.3% accurate, 17.5× speedup?

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

                                                            1. Initial program 63.5%

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

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

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

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

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

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

                                                              if -3.90000000000000012e-168 < F

                                                              1. Initial program 80.0%

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

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

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

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

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

                                                                  \[\leadsto \frac{-1 - x}{B} \]
                                                                2. Taylor expanded in F around 0

                                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                3. Step-by-step derivation
                                                                  1. mul-1-negN/A

                                                                    \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                                  2. lower-neg.f6434.5

                                                                    \[\leadsto \frac{-x}{B} \]
                                                                4. Applied rewrites34.5%

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

                                                              Alternative 24: 29.0% accurate, 26.3× speedup?

                                                              \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                              (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                              double code(double F, double B, double x) {
                                                              	return -x / 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 / b
                                                              end function
                                                              
                                                              public static double code(double F, double B, double x) {
                                                              	return -x / B;
                                                              }
                                                              
                                                              def code(F, B, x):
                                                              	return -x / B
                                                              
                                                              function code(F, B, x)
                                                              	return Float64(Float64(-x) / B)
                                                              end
                                                              
                                                              function tmp = code(F, B, x)
                                                              	tmp = -x / B;
                                                              end
                                                              
                                                              code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              \frac{-x}{B}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Initial program 72.8%

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

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

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

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

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

                                                                  \[\leadsto \frac{-1 - x}{B} \]
                                                                2. Taylor expanded in F around 0

                                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                3. Step-by-step derivation
                                                                  1. mul-1-negN/A

                                                                    \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                                  2. lower-neg.f6427.5

                                                                    \[\leadsto \frac{-x}{B} \]
                                                                4. Applied rewrites27.5%

                                                                  \[\leadsto \frac{-x}{B} \]
                                                                5. Add Preprocessing

                                                                Reproduce

                                                                ?
                                                                herbie shell --seed 2025058 
                                                                (FPCore (F B x)
                                                                  :name "VandenBroeck and Keller, Equation (23)"
                                                                  :precision binary64
                                                                  (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))