
(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}
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -3.6e+45)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 8e+25)
(+ t_0 (* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(+ (* (- x) (/ (cos B) (sin B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -3.6e+45) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 8e+25) {
tmp = t_0 + ((F / sin(B)) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else {
tmp = (-x * (cos(B) / sin(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -3.6e+45) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 8e+25) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); else tmp = Float64(Float64(Float64(-x) * Float64(cos(B) / sin(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.6e+45], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e+25], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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 -3.6 \cdot 10^{+45}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+25}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.6e45Initial program 54.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -3.6e45 < F < 8.00000000000000072e25Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around inf
lower-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6499.3
Applied rewrites99.3%
if 8.00000000000000072e25 < F Initial program 53.8%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites70.2%
Taylor expanded in B around inf
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f6470.2
Applied rewrites70.2%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B))))
(t_1 (+ t_0 (* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F))))))))
(t_2 (/ F (sin B)))
(t_3 (* (/ 1.0 (sqrt (fma F F 2.0))) t_2))
(t_4 (+ t_0 (* t_2 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))))
(if (<= t_4 -10.0)
t_1
(if (<= t_4 -5e-52)
t_3
(if (<= t_4 2e-66)
t_1
(if (<= t_4 10.0) t_3 (if (<= t_4 5e+302) t_1 (/ (- 1.0 x) B))))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double t_1 = t_0 + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
double t_2 = F / sin(B);
double t_3 = (1.0 / sqrt(fma(F, F, 2.0))) * t_2;
double t_4 = t_0 + (t_2 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double tmp;
if (t_4 <= -10.0) {
tmp = t_1;
} else if (t_4 <= -5e-52) {
tmp = t_3;
} else if (t_4 <= 2e-66) {
tmp = t_1;
} else if (t_4 <= 10.0) {
tmp = t_3;
} else if (t_4 <= 5e+302) {
tmp = t_1;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) t_1 = Float64(t_0 + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))) t_2 = Float64(F / sin(B)) t_3 = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * t_2) t_4 = Float64(t_0 + Float64(t_2 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) tmp = 0.0 if (t_4 <= -10.0) tmp = t_1; elseif (t_4 <= -5e-52) tmp = t_3; elseif (t_4 <= 2e-66) tmp = t_1; elseif (t_4 <= 10.0) tmp = t_3; elseif (t_4 <= 5e+302) tmp = t_1; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 + N[(t$95$2 * 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]}, If[LessEqual[t$95$4, -10.0], t$95$1, If[LessEqual[t$95$4, -5e-52], t$95$3, If[LessEqual[t$95$4, 2e-66], t$95$1, If[LessEqual[t$95$4, 10.0], t$95$3, If[LessEqual[t$95$4, 5e+302], t$95$1, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := t\_0 + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
t_2 := \frac{F}{\sin B}\\
t_3 := \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot t\_2\\
t_4 := t\_0 + t\_2 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
\mathbf{if}\;t\_4 \leq -10:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-52}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 10:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -10 or -5e-52 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2e-66 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 5e302Initial program 87.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites89.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6479.9
Applied rewrites79.9%
if -10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -5e-52 or 2e-66 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10Initial program 88.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6465.8
Applied rewrites65.8%
lift-pow.f64N/A
lift-fma.f64N/A
lower-sqrt.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6465.8
Applied rewrites65.8%
if 5e302 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 21.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites66.1%
Taylor expanded in F around inf
Applied rewrites78.8%
Final simplification77.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -2450000.0)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 5.5e-54)
(+ t_0 (* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(if (<= F 250000.0)
(+
(* (- x) (/ 1.0 (sin B)))
(/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)))
(/ (- 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 <= -2450000.0) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 5.5e-54) {
tmp = t_0 + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else if (F <= 250000.0) {
tmp = (-x * (1.0 / sin(B))) + ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -2450000.0) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 5.5e-54) tmp = Float64(t_0 + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); elseif (F <= 250000.0) tmp = Float64(Float64(Float64(-x) * Float64(1.0 / sin(B))) + Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2450000.0], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.5e-54], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 250000.0], N[(N[((-x) * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $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 -2450000:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-54}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{elif}\;F \leq 250000:\\
\;\;\;\;\left(-x\right) \cdot \frac{1}{\sin B} + \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.45e6Initial program 59.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -2.45e6 < F < 5.50000000000000046e-54Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6484.3
Applied rewrites84.3%
if 5.50000000000000046e-54 < F < 2.5e5Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
Taylor expanded in B around inf
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
Applied rewrites99.4%
Taylor expanded in B around 0
Applied rewrites81.3%
if 2.5e5 < F Initial program 56.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Final simplification92.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -3.6e+45)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 8e+25)
(+ t_0 (* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* 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 <= -3.6e+45) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 8e+25) {
tmp = t_0 + ((F / sin(B)) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -3.6e+45) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 8e+25) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.6e+45], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e+25], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $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 -3.6 \cdot 10^{+45}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+25}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -3.6e45Initial program 54.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -3.6e45 < F < 8.00000000000000072e25Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around inf
lower-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6499.3
Applied rewrites99.3%
if 8.00000000000000072e25 < F Initial program 53.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -2450000.0)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 4e-26)
(+ t_0 (* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(if (<= F 230000000.0)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
(/ (- 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 <= -2450000.0) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 4e-26) {
tmp = t_0 + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else if (F <= 230000000.0) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -2450000.0) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 4e-26) tmp = Float64(t_0 + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); elseif (F <= 230000000.0) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2450000.0], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e-26], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 230000000.0], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $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 -2450000:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-26}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{elif}\;F \leq 230000000:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.45e6Initial program 59.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -2.45e6 < F < 4.0000000000000002e-26Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6483.7
Applied rewrites83.7%
if 4.0000000000000002e-26 < F < 2.3e8Initial program 99.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6464.8
Applied rewrites64.8%
lift-pow.f64N/A
lift-fma.f64N/A
lower-sqrt.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6464.7
Applied rewrites64.7%
if 2.3e8 < F Initial program 56.1%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification91.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2450000.0)
(/ (- -1.0 t_0) (sin B))
(if (<= F 4e-26)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(if (<= F 230000000.0)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
(/ (- 1.0 t_0) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2450000.0) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 4e-26) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else if (F <= 230000000.0) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2450000.0) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 4e-26) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); elseif (F <= 230000000.0) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2450000.0], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e-26], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 230000000.0], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $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 -2450000:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-26}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{elif}\;F \leq 230000000:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.45e6Initial program 59.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -2.45e6 < F < 4.0000000000000002e-26Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6483.7
Applied rewrites83.7%
if 4.0000000000000002e-26 < F < 2.3e8Initial program 99.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6464.8
Applied rewrites64.8%
lift-pow.f64N/A
lift-fma.f64N/A
lower-sqrt.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6464.7
Applied rewrites64.7%
if 2.3e8 < F Initial program 56.1%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification91.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.85e+68)
(+ (- (/ x B)) (/ -1.0 (sin B)))
(if (<= F 4e-26)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(if (<= F 230000000.0)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
(/ (- 1.0 (* (cos B) x)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.85e+68) {
tmp = -(x / B) + (-1.0 / sin(B));
} else if (F <= 4e-26) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else if (F <= 230000000.0) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.85e+68) tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B))); elseif (F <= 4e-26) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); elseif (F <= 230000000.0) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.85e+68], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e-26], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 230000000.0], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $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 -1.85 \cdot 10^{+68}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-26}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{elif}\;F \leq 230000000:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.84999999999999999e68Initial program 51.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f6475.6
Applied rewrites75.6%
if -1.84999999999999999e68 < F < 4.0000000000000002e-26Initial program 99.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6482.2
Applied rewrites82.2%
if 4.0000000000000002e-26 < F < 2.3e8Initial program 99.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6464.8
Applied rewrites64.8%
lift-pow.f64N/A
lift-fma.f64N/A
lower-sqrt.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6464.7
Applied rewrites64.7%
if 2.3e8 < F Initial program 56.1%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification84.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sqrt (fma 2.0 x (fma F F 2.0))))))
(if (<= B 0.00045)
(/
(-
(fma (fma 0.3333333333333333 x (* 0.16666666666666666 t_0)) (* B B) t_0)
x)
B)
(+
(* x (/ -1.0 (tan B)))
(/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (* B B)))))))))
double code(double F, double B, double x) {
double t_0 = F / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double tmp;
if (B <= 0.00045) {
tmp = (fma(fma(0.3333333333333333, x, (0.16666666666666666 * t_0)), (B * B), t_0) - x) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / (B * (1.0 + (-0.16666666666666666 * (B * B)))));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) tmp = 0.0 if (B <= 0.00045) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, Float64(0.16666666666666666 * t_0)), Float64(B * B), t_0) - x) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * Float64(B * B)))))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.00045], N[(N[(N[(N[(0.3333333333333333 * x + N[(0.16666666666666666 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.00045:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666 \cdot t\_0\right), B \cdot B, t\_0\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)}\\
\end{array}
\end{array}
if B < 4.4999999999999999e-4Initial program 74.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.3%
Taylor expanded in B around inf
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f6485.3
Applied rewrites85.3%
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
Applied rewrites85.4%
Taylor expanded in B around 0
Applied rewrites58.8%
if 4.4999999999999999e-4 < B Initial program 86.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6455.5
Applied rewrites55.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6453.9
Applied rewrites53.9%
Final simplification57.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sqrt (fma 2.0 x (fma F F 2.0))))))
(if (<= F -2450000.0)
(+ (- (/ x B)) (/ -1.0 (sin B)))
(if (<= F 7.5e-29)
(/
(-
(fma
(fma 0.3333333333333333 x (* 0.16666666666666666 t_0))
(* B B)
t_0)
x)
B)
(if (<= F 1.42) (/ (* F (sqrt 0.5)) (sin B)) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = F / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double tmp;
if (F <= -2450000.0) {
tmp = -(x / B) + (-1.0 / sin(B));
} else if (F <= 7.5e-29) {
tmp = (fma(fma(0.3333333333333333, x, (0.16666666666666666 * t_0)), (B * B), t_0) - x) / B;
} else if (F <= 1.42) {
tmp = (F * sqrt(0.5)) / sin(B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) tmp = 0.0 if (F <= -2450000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B))); elseif (F <= 7.5e-29) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, Float64(0.16666666666666666 * t_0)), Float64(B * B), t_0) - x) / B); elseif (F <= 1.42) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2450000.0], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-29], N[(N[(N[(N[(0.3333333333333333 * x + N[(0.16666666666666666 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.42], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;F \leq -2450000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666 \cdot t\_0\right), B \cdot B, t\_0\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.45e6Initial program 59.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f6476.5
Applied rewrites76.5%
if -2.45e6 < F < 7.50000000000000006e-29Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around inf
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
Applied rewrites99.4%
Taylor expanded in B around 0
Applied rewrites52.2%
if 7.50000000000000006e-29 < F < 1.4199999999999999Initial program 99.4%
Taylor expanded in F around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6491.0
Applied rewrites91.0%
Taylor expanded in x around 0
metadata-evalN/A
sqrt-unprodN/A
sqrt-unprodN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
metadata-evalN/A
lift-sin.f6458.0
Applied rewrites58.0%
if 1.4199999999999999 < F Initial program 57.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6424.8
Applied rewrites24.8%
Taylor expanded in F around inf
inv-powN/A
lower-pow.f64N/A
lift-sin.f6453.6
Applied rewrites53.6%
lift-pow.f64N/A
lift-sin.f64N/A
inv-powN/A
lower-/.f64N/A
lift-sin.f6453.6
Applied rewrites53.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sqrt (fma 2.0 x (fma F F 2.0))))))
(if (<= F -8e+151)
(/ -1.0 (sin B))
(if (<= F 7.5e-29)
(/
(-
(fma
(fma 0.3333333333333333 x (* 0.16666666666666666 t_0))
(* B B)
t_0)
x)
B)
(if (<= F 1.42) (/ (* F (sqrt 0.5)) (sin B)) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = F / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double tmp;
if (F <= -8e+151) {
tmp = -1.0 / sin(B);
} else if (F <= 7.5e-29) {
tmp = (fma(fma(0.3333333333333333, x, (0.16666666666666666 * t_0)), (B * B), t_0) - x) / B;
} else if (F <= 1.42) {
tmp = (F * sqrt(0.5)) / sin(B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) tmp = 0.0 if (F <= -8e+151) tmp = Float64(-1.0 / sin(B)); elseif (F <= 7.5e-29) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, Float64(0.16666666666666666 * t_0)), Float64(B * B), t_0) - x) / B); elseif (F <= 1.42) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8e+151], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-29], N[(N[(N[(N[(0.3333333333333333 * x + N[(0.16666666666666666 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.42], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;F \leq -8 \cdot 10^{+151}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666 \cdot t\_0\right), B \cdot B, t\_0\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -8.00000000000000014e151Initial program 33.4%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f642.3
Applied rewrites2.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6447.2
Applied rewrites47.2%
if -8.00000000000000014e151 < F < 7.50000000000000006e-29Initial program 97.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around inf
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites52.5%
if 7.50000000000000006e-29 < F < 1.4199999999999999Initial program 99.4%
Taylor expanded in F around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6491.0
Applied rewrites91.0%
Taylor expanded in x around 0
metadata-evalN/A
sqrt-unprodN/A
sqrt-unprodN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
metadata-evalN/A
lift-sin.f6458.0
Applied rewrites58.0%
if 1.4199999999999999 < F Initial program 57.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6424.8
Applied rewrites24.8%
Taylor expanded in F around inf
inv-powN/A
lower-pow.f64N/A
lift-sin.f6453.6
Applied rewrites53.6%
lift-pow.f64N/A
lift-sin.f64N/A
inv-powN/A
lower-/.f64N/A
lift-sin.f6453.6
Applied rewrites53.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sqrt (fma 2.0 x (fma F F 2.0))))))
(if (<= B 0.00045)
(/
(-
(fma (fma 0.3333333333333333 x (* 0.16666666666666666 t_0)) (* B B) t_0)
x)
B)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B)))))
double code(double F, double B, double x) {
double t_0 = F / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double tmp;
if (B <= 0.00045) {
tmp = (fma(fma(0.3333333333333333, x, (0.16666666666666666 * t_0)), (B * B), t_0) - x) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) tmp = 0.0 if (B <= 0.00045) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, Float64(0.16666666666666666 * t_0)), Float64(B * B), t_0) - x) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.00045], N[(N[(N[(N[(0.3333333333333333 * x + N[(0.16666666666666666 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.00045:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666 \cdot t\_0\right), B \cdot B, t\_0\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\end{array}
\end{array}
if B < 4.4999999999999999e-4Initial program 74.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.3%
Taylor expanded in B around inf
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f6485.3
Applied rewrites85.3%
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
Applied rewrites85.4%
Taylor expanded in B around 0
Applied rewrites58.8%
if 4.4999999999999999e-4 < B Initial program 86.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6455.5
Applied rewrites55.5%
Taylor expanded in B around 0
Applied rewrites50.9%
Final simplification56.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sqrt (fma 2.0 x (fma F F 2.0))))))
(if (<= F -8e+151)
(/ -1.0 (sin B))
(if (<= F 5.2e+16)
(/
(-
(fma
(fma 0.3333333333333333 x (* 0.16666666666666666 t_0))
(* B B)
t_0)
x)
B)
(/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double t_0 = F / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double tmp;
if (F <= -8e+151) {
tmp = -1.0 / sin(B);
} else if (F <= 5.2e+16) {
tmp = (fma(fma(0.3333333333333333, x, (0.16666666666666666 * t_0)), (B * B), t_0) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) tmp = 0.0 if (F <= -8e+151) tmp = Float64(-1.0 / sin(B)); elseif (F <= 5.2e+16) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, Float64(0.16666666666666666 * t_0)), Float64(B * B), t_0) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8e+151], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e+16], N[(N[(N[(N[(0.3333333333333333 * x + N[(0.16666666666666666 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;F \leq -8 \cdot 10^{+151}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666 \cdot t\_0\right), B \cdot B, t\_0\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -8.00000000000000014e151Initial program 33.4%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f642.3
Applied rewrites2.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6447.2
Applied rewrites47.2%
if -8.00000000000000014e151 < F < 5.2e16Initial program 97.7%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around inf
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites52.5%
if 5.2e16 < F Initial program 54.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6422.9
Applied rewrites22.9%
Taylor expanded in F around inf
inv-powN/A
lower-pow.f64N/A
lift-sin.f6453.7
Applied rewrites53.7%
lift-pow.f64N/A
lift-sin.f64N/A
inv-powN/A
lower-/.f64N/A
lift-sin.f6453.7
Applied rewrites53.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sqrt (fma 2.0 x (fma F F 2.0))))))
(if (<= F -8e+151)
(/ -1.0 (sin B))
(if (<= F 0.027)
(/
(-
(fma
(fma 0.3333333333333333 x (* 0.16666666666666666 t_0))
(* B B)
t_0)
x)
B)
(fma (/ (/ (/ (fma 2.0 x 2.0) B) F) F) -0.5 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = F / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double tmp;
if (F <= -8e+151) {
tmp = -1.0 / sin(B);
} else if (F <= 0.027) {
tmp = (fma(fma(0.3333333333333333, x, (0.16666666666666666 * t_0)), (B * B), t_0) - x) / B;
} else {
tmp = fma((((fma(2.0, x, 2.0) / B) / F) / F), -0.5, ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) tmp = 0.0 if (F <= -8e+151) tmp = Float64(-1.0 / sin(B)); elseif (F <= 0.027) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, Float64(0.16666666666666666 * t_0)), Float64(B * B), t_0) - x) / B); else tmp = fma(Float64(Float64(Float64(fma(2.0, x, 2.0) / B) / F) / F), -0.5, Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8e+151], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.027], N[(N[(N[(N[(0.3333333333333333 * x + N[(0.16666666666666666 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / B), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision] * -0.5 + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;F \leq -8 \cdot 10^{+151}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 0.027:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666 \cdot t\_0\right), B \cdot B, t\_0\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F}}{F}, -0.5, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -8.00000000000000014e151Initial program 33.4%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f642.3
Applied rewrites2.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6447.2
Applied rewrites47.2%
if -8.00000000000000014e151 < F < 0.0269999999999999997Initial program 97.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around inf
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites52.5%
if 0.0269999999999999997 < F Initial program 57.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around -inf
Applied rewrites24.3%
Taylor expanded in F around inf
associate--l+N/A
*-commutativeN/A
div-subN/A
lower-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower--.f6443.3
Applied rewrites43.3%
metadata-evalN/A
metadata-evalN/A
Applied rewrites50.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sqrt (fma 2.0 x (fma F F 2.0))))))
(if (<= F -9.2e+60)
(/ (- -1.0 x) B)
(if (<= F 0.027)
(/
(-
(fma
(fma 0.3333333333333333 x (* 0.16666666666666666 t_0))
(* B B)
t_0)
x)
B)
(fma (/ (/ (/ (fma 2.0 x 2.0) B) F) F) -0.5 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = F / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double tmp;
if (F <= -9.2e+60) {
tmp = (-1.0 - x) / B;
} else if (F <= 0.027) {
tmp = (fma(fma(0.3333333333333333, x, (0.16666666666666666 * t_0)), (B * B), t_0) - x) / B;
} else {
tmp = fma((((fma(2.0, x, 2.0) / B) / F) / F), -0.5, ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) tmp = 0.0 if (F <= -9.2e+60) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 0.027) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, Float64(0.16666666666666666 * t_0)), Float64(B * B), t_0) - x) / B); else tmp = fma(Float64(Float64(Float64(fma(2.0, x, 2.0) / B) / F) / F), -0.5, Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9.2e+60], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.027], N[(N[(N[(N[(0.3333333333333333 * x + N[(0.16666666666666666 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / B), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision] * -0.5 + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;F \leq -9.2 \cdot 10^{+60}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 0.027:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666 \cdot t\_0\right), B \cdot B, t\_0\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F}}{F}, -0.5, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -9.20000000000000068e60Initial program 52.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.4%
Taylor expanded in F around -inf
Applied rewrites52.9%
if -9.20000000000000068e60 < F < 0.0269999999999999997Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around inf
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites52.4%
if 0.0269999999999999997 < F Initial program 57.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around -inf
Applied rewrites24.3%
Taylor expanded in F around inf
associate--l+N/A
*-commutativeN/A
div-subN/A
lower-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower--.f6443.3
Applied rewrites43.3%
metadata-evalN/A
metadata-evalN/A
Applied rewrites50.8%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+99)
(/ (- -1.0 x) B)
(if (<= F 2.05e+170)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+99) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.05e+170) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+99) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.05e+170) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+99], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.05e+170], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+99}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.05 \cdot 10^{+170}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.00000000000000008e99Initial program 46.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites34.5%
Taylor expanded in F around -inf
Applied rewrites52.7%
if -5.00000000000000008e99 < F < 2.05e170Initial program 95.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites98.5%
Taylor expanded in B around inf
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f6498.4
Applied rewrites98.4%
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
Applied rewrites98.5%
Taylor expanded in B around 0
Applied rewrites51.8%
if 2.05e170 < F Initial program 29.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites26.8%
Taylor expanded in F around inf
Applied rewrites51.2%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+27)
(/ (- -1.0 x) B)
(if (<= F 0.027)
(/ (- (* F (/ 1.0 (sqrt (fma F F 2.0)))) x) B)
(fma (/ 2.0 (* (* F F) B)) -0.5 (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+27) {
tmp = (-1.0 - x) / B;
} else if (F <= 0.027) {
tmp = ((F * (1.0 / sqrt(fma(F, F, 2.0)))) - x) / B;
} else {
tmp = fma((2.0 / ((F * F) * B)), -0.5, ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+27) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 0.027) tmp = Float64(Float64(Float64(F * Float64(1.0 / sqrt(fma(F, F, 2.0)))) - x) / B); else tmp = fma(Float64(2.0 / Float64(Float64(F * F) * B)), -0.5, Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+27], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.027], N[(N[(N[(F * N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(2.0 / N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+27}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 0.027:\\
\;\;\;\;\frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{2}{\left(F \cdot F\right) \cdot B}, -0.5, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -1e27Initial program 57.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.9%
Taylor expanded in F around -inf
Applied rewrites52.9%
if -1e27 < F < 0.0269999999999999997Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.4%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6452.4
Applied rewrites52.4%
if 0.0269999999999999997 < F Initial program 57.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around -inf
Applied rewrites24.3%
Taylor expanded in F around inf
associate--l+N/A
*-commutativeN/A
div-subN/A
lower-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower--.f6443.3
Applied rewrites43.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6450.9
Applied rewrites50.9%
Final simplification52.1%
(FPCore (F B x)
:precision binary64
(if (<= F -0.00011)
(/ (- (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) 1.0) x) B)
(if (<= F 0.027)
(/ (- (* F (/ 1.0 (sqrt (fma 2.0 x 2.0)))) x) B)
(fma (/ 2.0 (* (* F F) B)) -0.5 (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.00011) {
tmp = ((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - 1.0) - x) / B;
} else if (F <= 0.027) {
tmp = ((F * (1.0 / sqrt(fma(2.0, x, 2.0)))) - x) / B;
} else {
tmp = fma((2.0 / ((F * F) * B)), -0.5, ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.00011) tmp = Float64(Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - 1.0) - x) / B); elseif (F <= 0.027) tmp = Float64(Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, 2.0)))) - x) / B); else tmp = fma(Float64(2.0 / Float64(Float64(F * F) * B)), -0.5, Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.00011], N[(N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.027], N[(N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(2.0 / N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.00011:\\
\;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - 1\right) - x}{B}\\
\mathbf{elif}\;F \leq 0.027:\\
\;\;\;\;\frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{2}{\left(F \cdot F\right) \cdot B}, -0.5, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -1.10000000000000004e-4Initial program 60.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites40.1%
Taylor expanded in F around -inf
Applied rewrites52.5%
Taylor expanded in F around -inf
metadata-evalN/A
associate--r+N/A
lower--.f64N/A
Applied rewrites52.3%
if -1.10000000000000004e-4 < F < 0.0269999999999999997Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.3%
Taylor expanded in F around 0
lower-sqrt.f64N/A
+-commutativeN/A
lower-fma.f6452.1
Applied rewrites52.1%
if 0.0269999999999999997 < F Initial program 57.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around -inf
Applied rewrites24.3%
Taylor expanded in F around inf
associate--l+N/A
*-commutativeN/A
div-subN/A
lower-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower--.f6443.3
Applied rewrites43.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6450.9
Applied rewrites50.9%
Final simplification51.8%
(FPCore (F B x)
:precision binary64
(if (<= F -8.4e-7)
(/ (- (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) 1.0) x) B)
(if (<= F 0.012)
(/ (- x) B)
(fma (/ 2.0 (* (* F F) B)) -0.5 (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.4e-7) {
tmp = ((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - 1.0) - x) / B;
} else if (F <= 0.012) {
tmp = -x / B;
} else {
tmp = fma((2.0 / ((F * F) * B)), -0.5, ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8.4e-7) tmp = Float64(Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - 1.0) - x) / B); elseif (F <= 0.012) tmp = Float64(Float64(-x) / B); else tmp = fma(Float64(2.0 / Float64(Float64(F * F) * B)), -0.5, Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8.4e-7], N[(N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.012], N[((-x) / B), $MachinePrecision], N[(N[(2.0 / N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.4 \cdot 10^{-7}:\\
\;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - 1\right) - x}{B}\\
\mathbf{elif}\;F \leq 0.012:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{2}{\left(F \cdot F\right) \cdot B}, -0.5, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -8.4e-7Initial program 60.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites40.3%
Taylor expanded in F around -inf
Applied rewrites52.3%
Taylor expanded in F around -inf
metadata-evalN/A
associate--r+N/A
lower--.f64N/A
Applied rewrites52.1%
if -8.4e-7 < F < 0.012Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.3%
Taylor expanded in F around -inf
Applied rewrites20.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6436.1
Applied rewrites36.1%
if 0.012 < F Initial program 57.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around -inf
Applied rewrites24.3%
Taylor expanded in F around inf
associate--l+N/A
*-commutativeN/A
div-subN/A
lower-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower--.f6443.3
Applied rewrites43.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6450.9
Applied rewrites50.9%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e-32)
(/ (- (* (/ -1.0 F) F) x) B)
(if (<= F 0.012)
(/ (- x) B)
(fma (/ 2.0 (* (* F F) B)) -0.5 (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e-32) {
tmp = (((-1.0 / F) * F) - x) / B;
} else if (F <= 0.012) {
tmp = -x / B;
} else {
tmp = fma((2.0 / ((F * F) * B)), -0.5, ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.3e-32) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - x) / B); elseif (F <= 0.012) tmp = Float64(Float64(-x) / B); else tmp = fma(Float64(2.0 / Float64(Float64(F * F) * B)), -0.5, Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.3e-32], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.012], N[((-x) / B), $MachinePrecision], N[(N[(2.0 / N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 0.012:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{2}{\left(F \cdot F\right) \cdot B}, -0.5, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -1.2999999999999999e-32Initial program 62.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites41.1%
Taylor expanded in F around -inf
lower-/.f6450.4
Applied rewrites50.4%
if -1.2999999999999999e-32 < F < 0.012Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.2%
Taylor expanded in F around -inf
Applied rewrites20.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6436.8
Applied rewrites36.8%
if 0.012 < F Initial program 57.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around -inf
Applied rewrites24.3%
Taylor expanded in F around inf
associate--l+N/A
*-commutativeN/A
div-subN/A
lower-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower--.f6443.3
Applied rewrites43.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6450.9
Applied rewrites50.9%
(FPCore (F B x) :precision binary64 (if (<= F -1.3e-32) (/ (- (* (/ -1.0 F) F) x) B) (if (<= F 1e-19) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e-32) {
tmp = (((-1.0 / F) * F) - x) / B;
} else if (F <= 1e-19) {
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 <= (-1.3d-32)) then
tmp = ((((-1.0d0) / f) * f) - x) / b
else if (f <= 1d-19) 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 <= -1.3e-32) {
tmp = (((-1.0 / F) * F) - x) / B;
} else if (F <= 1e-19) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.3e-32: tmp = (((-1.0 / F) * F) - x) / B elif F <= 1e-19: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.3e-32) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - x) / B); elseif (F <= 1e-19) 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 <= -1.3e-32) tmp = (((-1.0 / F) * F) - x) / B; elseif (F <= 1e-19) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.3e-32], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1e-19], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 10^{-19}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.2999999999999999e-32Initial program 62.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites41.1%
Taylor expanded in F around -inf
lower-/.f6450.4
Applied rewrites50.4%
if -1.2999999999999999e-32 < F < 9.9999999999999998e-20Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.0%
Taylor expanded in F around -inf
Applied rewrites20.5%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6437.4
Applied rewrites37.4%
if 9.9999999999999998e-20 < F Initial program 59.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.9%
Taylor expanded in F around inf
Applied rewrites49.4%
(FPCore (F B x) :precision binary64 (if (<= F -1.3e-32) (/ (- -1.0 x) B) (if (<= F 1e-19) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e-32) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e-19) {
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 <= (-1.3d-32)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1d-19) 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 <= -1.3e-32) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e-19) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.3e-32: tmp = (-1.0 - x) / B elif F <= 1e-19: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.3e-32) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1e-19) 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 <= -1.3e-32) tmp = (-1.0 - x) / B; elseif (F <= 1e-19) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.3e-32], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1e-19], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 10^{-19}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.2999999999999999e-32Initial program 62.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites41.1%
Taylor expanded in F around -inf
Applied rewrites50.5%
if -1.2999999999999999e-32 < F < 9.9999999999999998e-20Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.0%
Taylor expanded in F around -inf
Applied rewrites20.5%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6437.4
Applied rewrites37.4%
if 9.9999999999999998e-20 < F Initial program 59.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.9%
Taylor expanded in F around inf
Applied rewrites49.4%
(FPCore (F B x) :precision binary64 (if (<= F -1.3e-32) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e-32) {
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 <= (-1.3d-32)) 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 <= -1.3e-32) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.3e-32: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.3e-32) 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 <= -1.3e-32) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.3e-32], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.2999999999999999e-32Initial program 62.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites41.1%
Taylor expanded in F around -inf
Applied rewrites50.5%
if -1.2999999999999999e-32 < F Initial program 83.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites46.8%
Taylor expanded in F around -inf
Applied rewrites21.9%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6432.3
Applied rewrites32.3%
(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}
Initial program 77.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites45.1%
Taylor expanded in F around -inf
Applied rewrites30.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6430.5
Applied rewrites30.5%
herbie shell --seed 2025086
(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))))))