
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
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(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
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(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
(FPCore (eh ew t) :precision binary64 (fabs (- (/ 1.0 (/ (sqrt (- (pow (/ (* (tan t) eh) ew) 2.0) -1.0)) (* (cos t) ew))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))
double code(double eh, double ew, double t) {
return fabs(((1.0 / (sqrt((pow(((tan(t) * eh) / ew), 2.0) - -1.0)) / (cos(t) * ew))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew))))));
}
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(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((1.0d0 / (sqrt(((((tan(t) * eh) / ew) ** 2.0d0) - (-1.0d0))) / (cos(t) * ew))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((1.0 / (Math.sqrt((Math.pow(((Math.tan(t) * eh) / ew), 2.0) - -1.0)) / (Math.cos(t) * ew))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((-eh * Math.tan(t)) / ew))))));
}
def code(eh, ew, t): return math.fabs(((1.0 / (math.sqrt((math.pow(((math.tan(t) * eh) / ew), 2.0) - -1.0)) / (math.cos(t) * ew))) - ((eh * math.sin(t)) * math.sin(math.atan(((-eh * math.tan(t)) / ew))))))
function code(eh, ew, t) return abs(Float64(Float64(1.0 / Float64(sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) - -1.0)) / Float64(cos(t) * ew))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs(((1.0 / (sqrt(((((tan(t) * eh) / ew) ^ 2.0) - -1.0)) / (cos(t) * ew))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(1.0 / N[(N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision] / N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\frac{1}{\frac{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} - -1}}{\cos t \cdot ew}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|
Initial program 99.8%
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
cos-atanN/A
mult-flip-revN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f64N/A
Applied rewrites99.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (tan t) ew)) (t_2 (- (fabs eh))))
(if (<= (fabs eh) 1.35e-48)
(fabs
(/
(-
(* (* (tan t) t_2) (* (/ 1.0 ew) (* (fabs eh) (sin t))))
(* (cos t) ew))
(sqrt (- (pow (/ (* (tan t) (fabs eh)) ew) 2.0) -1.0))))
(fabs
(*
(-
(*
(/ (cos t) (sqrt (- (pow (* t_1 (fabs eh)) 2.0) -1.0)))
(/ ew (fabs eh)))
(* (tanh (asinh (* t_1 t_2))) (sin t)))
(fabs eh))))))double code(double eh, double ew, double t) {
double t_1 = tan(t) / ew;
double t_2 = -fabs(eh);
double tmp;
if (fabs(eh) <= 1.35e-48) {
tmp = fabs(((((tan(t) * t_2) * ((1.0 / ew) * (fabs(eh) * sin(t)))) - (cos(t) * ew)) / sqrt((pow(((tan(t) * fabs(eh)) / ew), 2.0) - -1.0))));
} else {
tmp = fabs(((((cos(t) / sqrt((pow((t_1 * fabs(eh)), 2.0) - -1.0))) * (ew / fabs(eh))) - (tanh(asinh((t_1 * t_2))) * sin(t))) * fabs(eh)));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.tan(t) / ew t_2 = -math.fabs(eh) tmp = 0 if math.fabs(eh) <= 1.35e-48: tmp = math.fabs(((((math.tan(t) * t_2) * ((1.0 / ew) * (math.fabs(eh) * math.sin(t)))) - (math.cos(t) * ew)) / math.sqrt((math.pow(((math.tan(t) * math.fabs(eh)) / ew), 2.0) - -1.0)))) else: tmp = math.fabs(((((math.cos(t) / math.sqrt((math.pow((t_1 * math.fabs(eh)), 2.0) - -1.0))) * (ew / math.fabs(eh))) - (math.tanh(math.asinh((t_1 * t_2))) * math.sin(t))) * math.fabs(eh))) return tmp
function code(eh, ew, t) t_1 = Float64(tan(t) / ew) t_2 = Float64(-abs(eh)) tmp = 0.0 if (abs(eh) <= 1.35e-48) tmp = abs(Float64(Float64(Float64(Float64(tan(t) * t_2) * Float64(Float64(1.0 / ew) * Float64(abs(eh) * sin(t)))) - Float64(cos(t) * ew)) / sqrt(Float64((Float64(Float64(tan(t) * abs(eh)) / ew) ^ 2.0) - -1.0)))); else tmp = abs(Float64(Float64(Float64(Float64(cos(t) / sqrt(Float64((Float64(t_1 * abs(eh)) ^ 2.0) - -1.0))) * Float64(ew / abs(eh))) - Float64(tanh(asinh(Float64(t_1 * t_2))) * sin(t))) * abs(eh))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = tan(t) / ew; t_2 = -abs(eh); tmp = 0.0; if (abs(eh) <= 1.35e-48) tmp = abs(((((tan(t) * t_2) * ((1.0 / ew) * (abs(eh) * sin(t)))) - (cos(t) * ew)) / sqrt(((((tan(t) * abs(eh)) / ew) ^ 2.0) - -1.0)))); else tmp = abs(((((cos(t) / sqrt((((t_1 * abs(eh)) ^ 2.0) - -1.0))) * (ew / abs(eh))) - (tanh(asinh((t_1 * t_2))) * sin(t))) * abs(eh))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = (-N[Abs[eh], $MachinePrecision])}, If[LessEqual[N[Abs[eh], $MachinePrecision], 1.35e-48], N[Abs[N[(N[(N[(N[(N[Tan[t], $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[(1.0 / ew), $MachinePrecision] * N[(N[Abs[eh], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[Power[N[(t$95$1 * N[Abs[eh], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(ew / N[Abs[eh], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Tanh[N[ArcSinh[N[(t$95$1 * t$95$2), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{\tan t}{ew}\\
t_2 := -\left|eh\right|\\
\mathbf{if}\;\left|eh\right| \leq 1.35 \cdot 10^{-48}:\\
\;\;\;\;\left|\frac{\left(\tan t \cdot t\_2\right) \cdot \left(\frac{1}{ew} \cdot \left(\left|eh\right| \cdot \sin t\right)\right) - \cos t \cdot ew}{\sqrt{{\left(\frac{\tan t \cdot \left|eh\right|}{ew}\right)}^{2} - -1}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\frac{\cos t}{\sqrt{{\left(t\_1 \cdot \left|eh\right|\right)}^{2} - -1}} \cdot \frac{ew}{\left|eh\right|} - \tanh \sinh^{-1} \left(t\_1 \cdot t\_2\right) \cdot \sin t\right) \cdot \left|eh\right|\right|\\
\end{array}
if eh < 1.3500000000000001e-48Initial program 99.8%
Applied rewrites77.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6477.1%
Applied rewrites77.1%
if 1.3500000000000001e-48 < eh Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.8%
Applied rewrites87.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (- (fabs eh))))
(if (<= (fabs eh) 1.35e-48)
(fabs
(/
(-
(* (* (tan t) t_1) (* (/ 1.0 ew) (* (fabs eh) (sin t))))
(* (cos t) ew))
(sqrt (- (pow (/ (* (tan t) (fabs eh)) ew) 2.0) -1.0))))
(fabs
(*
(-
(/ (* ew (cos t)) (fabs eh))
(* (tanh (asinh (* (/ (tan t) ew) t_1))) (sin t)))
(fabs eh))))))double code(double eh, double ew, double t) {
double t_1 = -fabs(eh);
double tmp;
if (fabs(eh) <= 1.35e-48) {
tmp = fabs(((((tan(t) * t_1) * ((1.0 / ew) * (fabs(eh) * sin(t)))) - (cos(t) * ew)) / sqrt((pow(((tan(t) * fabs(eh)) / ew), 2.0) - -1.0))));
} else {
tmp = fabs(((((ew * cos(t)) / fabs(eh)) - (tanh(asinh(((tan(t) / ew) * t_1))) * sin(t))) * fabs(eh)));
}
return tmp;
}
def code(eh, ew, t): t_1 = -math.fabs(eh) tmp = 0 if math.fabs(eh) <= 1.35e-48: tmp = math.fabs(((((math.tan(t) * t_1) * ((1.0 / ew) * (math.fabs(eh) * math.sin(t)))) - (math.cos(t) * ew)) / math.sqrt((math.pow(((math.tan(t) * math.fabs(eh)) / ew), 2.0) - -1.0)))) else: tmp = math.fabs(((((ew * math.cos(t)) / math.fabs(eh)) - (math.tanh(math.asinh(((math.tan(t) / ew) * t_1))) * math.sin(t))) * math.fabs(eh))) return tmp
function code(eh, ew, t) t_1 = Float64(-abs(eh)) tmp = 0.0 if (abs(eh) <= 1.35e-48) tmp = abs(Float64(Float64(Float64(Float64(tan(t) * t_1) * Float64(Float64(1.0 / ew) * Float64(abs(eh) * sin(t)))) - Float64(cos(t) * ew)) / sqrt(Float64((Float64(Float64(tan(t) * abs(eh)) / ew) ^ 2.0) - -1.0)))); else tmp = abs(Float64(Float64(Float64(Float64(ew * cos(t)) / abs(eh)) - Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * t_1))) * sin(t))) * abs(eh))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = -abs(eh); tmp = 0.0; if (abs(eh) <= 1.35e-48) tmp = abs(((((tan(t) * t_1) * ((1.0 / ew) * (abs(eh) * sin(t)))) - (cos(t) * ew)) / sqrt(((((tan(t) * abs(eh)) / ew) ^ 2.0) - -1.0)))); else tmp = abs(((((ew * cos(t)) / abs(eh)) - (tanh(asinh(((tan(t) / ew) * t_1))) * sin(t))) * abs(eh))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = (-N[Abs[eh], $MachinePrecision])}, If[LessEqual[N[Abs[eh], $MachinePrecision], 1.35e-48], N[Abs[N[(N[(N[(N[(N[Tan[t], $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[(1.0 / ew), $MachinePrecision] * N[(N[Abs[eh], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision] - N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_1 := -\left|eh\right|\\
\mathbf{if}\;\left|eh\right| \leq 1.35 \cdot 10^{-48}:\\
\;\;\;\;\left|\frac{\left(\tan t \cdot t\_1\right) \cdot \left(\frac{1}{ew} \cdot \left(\left|eh\right| \cdot \sin t\right)\right) - \cos t \cdot ew}{\sqrt{{\left(\frac{\tan t \cdot \left|eh\right|}{ew}\right)}^{2} - -1}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\frac{ew \cdot \cos t}{\left|eh\right|} - \tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot t\_1\right) \cdot \sin t\right) \cdot \left|eh\right|\right|\\
\end{array}
if eh < 1.3500000000000001e-48Initial program 99.8%
Applied rewrites77.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6477.1%
Applied rewrites77.1%
if 1.3500000000000001e-48 < eh Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.8%
Applied rewrites87.7%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6486.5%
Applied rewrites86.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (/ (tan t) ew) (- (fabs eh)))))
(if (<= (fabs eh) 1.35e-48)
(fabs
(/
(- (* (* (sin t) (fabs eh)) t_1) (* (cos t) ew))
(sqrt (- (pow (/ (* (tan t) (fabs eh)) ew) 2.0) -1.0))))
(fabs
(*
(- (/ (* ew (cos t)) (fabs eh)) (* (tanh (asinh t_1)) (sin t)))
(fabs eh))))))double code(double eh, double ew, double t) {
double t_1 = (tan(t) / ew) * -fabs(eh);
double tmp;
if (fabs(eh) <= 1.35e-48) {
tmp = fabs(((((sin(t) * fabs(eh)) * t_1) - (cos(t) * ew)) / sqrt((pow(((tan(t) * fabs(eh)) / ew), 2.0) - -1.0))));
} else {
tmp = fabs(((((ew * cos(t)) / fabs(eh)) - (tanh(asinh(t_1)) * sin(t))) * fabs(eh)));
}
return tmp;
}
def code(eh, ew, t): t_1 = (math.tan(t) / ew) * -math.fabs(eh) tmp = 0 if math.fabs(eh) <= 1.35e-48: tmp = math.fabs(((((math.sin(t) * math.fabs(eh)) * t_1) - (math.cos(t) * ew)) / math.sqrt((math.pow(((math.tan(t) * math.fabs(eh)) / ew), 2.0) - -1.0)))) else: tmp = math.fabs(((((ew * math.cos(t)) / math.fabs(eh)) - (math.tanh(math.asinh(t_1)) * math.sin(t))) * math.fabs(eh))) return tmp
function code(eh, ew, t) t_1 = Float64(Float64(tan(t) / ew) * Float64(-abs(eh))) tmp = 0.0 if (abs(eh) <= 1.35e-48) tmp = abs(Float64(Float64(Float64(Float64(sin(t) * abs(eh)) * t_1) - Float64(cos(t) * ew)) / sqrt(Float64((Float64(Float64(tan(t) * abs(eh)) / ew) ^ 2.0) - -1.0)))); else tmp = abs(Float64(Float64(Float64(Float64(ew * cos(t)) / abs(eh)) - Float64(tanh(asinh(t_1)) * sin(t))) * abs(eh))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = (tan(t) / ew) * -abs(eh); tmp = 0.0; if (abs(eh) <= 1.35e-48) tmp = abs(((((sin(t) * abs(eh)) * t_1) - (cos(t) * ew)) / sqrt(((((tan(t) * abs(eh)) / ew) ^ 2.0) - -1.0)))); else tmp = abs(((((ew * cos(t)) / abs(eh)) - (tanh(asinh(t_1)) * sin(t))) * abs(eh))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-N[Abs[eh], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[N[Abs[eh], $MachinePrecision], 1.35e-48], N[Abs[N[(N[(N[(N[(N[Sin[t], $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision] - N[(N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{\tan t}{ew} \cdot \left(-\left|eh\right|\right)\\
\mathbf{if}\;\left|eh\right| \leq 1.35 \cdot 10^{-48}:\\
\;\;\;\;\left|\frac{\left(\sin t \cdot \left|eh\right|\right) \cdot t\_1 - \cos t \cdot ew}{\sqrt{{\left(\frac{\tan t \cdot \left|eh\right|}{ew}\right)}^{2} - -1}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\frac{ew \cdot \cos t}{\left|eh\right|} - \tanh \sinh^{-1} t\_1 \cdot \sin t\right) \cdot \left|eh\right|\right|\\
\end{array}
if eh < 1.3500000000000001e-48Initial program 99.8%
Applied rewrites77.1%
if 1.3500000000000001e-48 < eh Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.8%
Applied rewrites87.7%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6486.5%
Applied rewrites86.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (tan t) ew)) (t_2 (* t_1 (fabs eh))))
(if (<= (fabs eh) 1.35e-48)
(/
(fabs (fma (cos t) ew (* t_2 (* (fabs eh) (sin t)))))
(sqrt (- (pow t_2 2.0) -1.0)))
(fabs
(*
(-
(/ (* ew (cos t)) (fabs eh))
(* (tanh (asinh (* t_1 (- (fabs eh))))) (sin t)))
(fabs eh))))))double code(double eh, double ew, double t) {
double t_1 = tan(t) / ew;
double t_2 = t_1 * fabs(eh);
double tmp;
if (fabs(eh) <= 1.35e-48) {
tmp = fabs(fma(cos(t), ew, (t_2 * (fabs(eh) * sin(t))))) / sqrt((pow(t_2, 2.0) - -1.0));
} else {
tmp = fabs(((((ew * cos(t)) / fabs(eh)) - (tanh(asinh((t_1 * -fabs(eh)))) * sin(t))) * fabs(eh)));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(tan(t) / ew) t_2 = Float64(t_1 * abs(eh)) tmp = 0.0 if (abs(eh) <= 1.35e-48) tmp = Float64(abs(fma(cos(t), ew, Float64(t_2 * Float64(abs(eh) * sin(t))))) / sqrt(Float64((t_2 ^ 2.0) - -1.0))); else tmp = abs(Float64(Float64(Float64(Float64(ew * cos(t)) / abs(eh)) - Float64(tanh(asinh(Float64(t_1 * Float64(-abs(eh))))) * sin(t))) * abs(eh))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Abs[eh], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[eh], $MachinePrecision], 1.35e-48], N[(N[Abs[N[(N[Cos[t], $MachinePrecision] * ew + N[(t$95$2 * N[(N[Abs[eh], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[t$95$2, 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision] - N[(N[Tanh[N[ArcSinh[N[(t$95$1 * (-N[Abs[eh], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{\tan t}{ew}\\
t_2 := t\_1 \cdot \left|eh\right|\\
\mathbf{if}\;\left|eh\right| \leq 1.35 \cdot 10^{-48}:\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(\cos t, ew, t\_2 \cdot \left(\left|eh\right| \cdot \sin t\right)\right)\right|}{\sqrt{{t\_2}^{2} - -1}}\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\frac{ew \cdot \cos t}{\left|eh\right|} - \tanh \sinh^{-1} \left(t\_1 \cdot \left(-\left|eh\right|\right)\right) \cdot \sin t\right) \cdot \left|eh\right|\right|\\
\end{array}
if eh < 1.3500000000000001e-48Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Applied rewrites77.1%
if 1.3500000000000001e-48 < eh Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.8%
Applied rewrites87.7%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6486.5%
Applied rewrites86.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* eh (sin t)))
(t_2 (atan (/ (* -1.0 (* eh t)) (fabs ew))))
(t_3 (* (fabs ew) (cos t)))
(t_4 (atan (/ (* (- eh) (tan t)) (fabs ew)))))
(if (<= (- (* t_3 (cos t_4)) (* t_1 (sin t_4))) 1e-142)
(fabs
(*
(-
(/ t_3 eh)
(* (tanh (asinh (* (/ (tan t) (fabs ew)) (- eh)))) (sin t)))
eh))
(fabs (- (* t_3 (cos t_2)) (* t_1 (sin t_2)))))))double code(double eh, double ew, double t) {
double t_1 = eh * sin(t);
double t_2 = atan(((-1.0 * (eh * t)) / fabs(ew)));
double t_3 = fabs(ew) * cos(t);
double t_4 = atan(((-eh * tan(t)) / fabs(ew)));
double tmp;
if (((t_3 * cos(t_4)) - (t_1 * sin(t_4))) <= 1e-142) {
tmp = fabs((((t_3 / eh) - (tanh(asinh(((tan(t) / fabs(ew)) * -eh))) * sin(t))) * eh));
} else {
tmp = fabs(((t_3 * cos(t_2)) - (t_1 * sin(t_2))));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh * math.sin(t) t_2 = math.atan(((-1.0 * (eh * t)) / math.fabs(ew))) t_3 = math.fabs(ew) * math.cos(t) t_4 = math.atan(((-eh * math.tan(t)) / math.fabs(ew))) tmp = 0 if ((t_3 * math.cos(t_4)) - (t_1 * math.sin(t_4))) <= 1e-142: tmp = math.fabs((((t_3 / eh) - (math.tanh(math.asinh(((math.tan(t) / math.fabs(ew)) * -eh))) * math.sin(t))) * eh)) else: tmp = math.fabs(((t_3 * math.cos(t_2)) - (t_1 * math.sin(t_2)))) return tmp
function code(eh, ew, t) t_1 = Float64(eh * sin(t)) t_2 = atan(Float64(Float64(-1.0 * Float64(eh * t)) / abs(ew))) t_3 = Float64(abs(ew) * cos(t)) t_4 = atan(Float64(Float64(Float64(-eh) * tan(t)) / abs(ew))) tmp = 0.0 if (Float64(Float64(t_3 * cos(t_4)) - Float64(t_1 * sin(t_4))) <= 1e-142) tmp = abs(Float64(Float64(Float64(t_3 / eh) - Float64(tanh(asinh(Float64(Float64(tan(t) / abs(ew)) * Float64(-eh)))) * sin(t))) * eh)); else tmp = abs(Float64(Float64(t_3 * cos(t_2)) - Float64(t_1 * sin(t_2)))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh * sin(t); t_2 = atan(((-1.0 * (eh * t)) / abs(ew))); t_3 = abs(ew) * cos(t); t_4 = atan(((-eh * tan(t)) / abs(ew))); tmp = 0.0; if (((t_3 * cos(t_4)) - (t_1 * sin(t_4))) <= 1e-142) tmp = abs((((t_3 / eh) - (tanh(asinh(((tan(t) / abs(ew)) * -eh))) * sin(t))) * eh)); else tmp = abs(((t_3 * cos(t_2)) - (t_1 * sin(t_2)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(-1.0 * N[(eh * t), $MachinePrecision]), $MachinePrecision] / N[Abs[ew], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Abs[ew], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / N[Abs[ew], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$3 * N[Cos[t$95$4], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-142], N[Abs[N[(N[(N[(t$95$3 / eh), $MachinePrecision] - N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / N[Abs[ew], $MachinePrecision]), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(t$95$3 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := eh \cdot \sin t\\
t_2 := \tan^{-1} \left(\frac{-1 \cdot \left(eh \cdot t\right)}{\left|ew\right|}\right)\\
t_3 := \left|ew\right| \cdot \cos t\\
t_4 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{\left|ew\right|}\right)\\
\mathbf{if}\;t\_3 \cdot \cos t\_4 - t\_1 \cdot \sin t\_4 \leq 10^{-142}:\\
\;\;\;\;\left|\left(\frac{t\_3}{eh} - \tanh \sinh^{-1} \left(\frac{\tan t}{\left|ew\right|} \cdot \left(-eh\right)\right) \cdot \sin t\right) \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_3 \cdot \cos t\_2 - t\_1 \cdot \sin t\_2\right|\\
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < 1e-142Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.8%
Applied rewrites87.7%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6486.5%
Applied rewrites86.5%
if 1e-142 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6490.0%
Applied rewrites90.0%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6490.0%
Applied rewrites90.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))))
(if (<= (fabs eh) 5.8e-105)
(fabs t_1)
(fabs
(*
(-
(/ t_1 (fabs eh))
(* (tanh (asinh (* (/ (tan t) ew) (- (fabs eh))))) (sin t)))
(fabs eh))))))double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double tmp;
if (fabs(eh) <= 5.8e-105) {
tmp = fabs(t_1);
} else {
tmp = fabs((((t_1 / fabs(eh)) - (tanh(asinh(((tan(t) / ew) * -fabs(eh)))) * sin(t))) * fabs(eh)));
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.cos(t) tmp = 0 if math.fabs(eh) <= 5.8e-105: tmp = math.fabs(t_1) else: tmp = math.fabs((((t_1 / math.fabs(eh)) - (math.tanh(math.asinh(((math.tan(t) / ew) * -math.fabs(eh)))) * math.sin(t))) * math.fabs(eh))) return tmp
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) tmp = 0.0 if (abs(eh) <= 5.8e-105) tmp = abs(t_1); else tmp = abs(Float64(Float64(Float64(t_1 / abs(eh)) - Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-abs(eh))))) * sin(t))) * abs(eh))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * cos(t); tmp = 0.0; if (abs(eh) <= 5.8e-105) tmp = abs(t_1); else tmp = abs((((t_1 / abs(eh)) - (tanh(asinh(((tan(t) / ew) * -abs(eh)))) * sin(t))) * abs(eh))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[eh], $MachinePrecision], 5.8e-105], N[Abs[t$95$1], $MachinePrecision], N[Abs[N[(N[(N[(t$95$1 / N[Abs[eh], $MachinePrecision]), $MachinePrecision] - N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-N[Abs[eh], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_1 := ew \cdot \cos t\\
\mathbf{if}\;\left|eh\right| \leq 5.8 \cdot 10^{-105}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\frac{t\_1}{\left|eh\right|} - \tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-\left|eh\right|\right)\right) \cdot \sin t\right) \cdot \left|eh\right|\right|\\
\end{array}
if eh < 5.8000000000000001e-105Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.8%
Applied rewrites87.7%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.8%
Applied rewrites61.8%
if 5.8000000000000001e-105 < eh Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.8%
Applied rewrites87.7%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f6486.5%
Applied rewrites86.5%
(FPCore (eh ew t)
:precision binary64
(if (<= (fabs eh) 58000000.0)
(fabs (* ew (cos t)))
(fabs
(*
-1.0
(* (fabs eh) (* (sin t) (sin (atan (* -1.0 (/ (* (fabs eh) t) ew))))))))))double code(double eh, double ew, double t) {
double tmp;
if (fabs(eh) <= 58000000.0) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((-1.0 * (fabs(eh) * (sin(t) * sin(atan((-1.0 * ((fabs(eh) * t) / ew))))))));
}
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(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (abs(eh) <= 58000000.0d0) then
tmp = abs((ew * cos(t)))
else
tmp = abs(((-1.0d0) * (abs(eh) * (sin(t) * sin(atan(((-1.0d0) * ((abs(eh) * t) / ew))))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (Math.abs(eh) <= 58000000.0) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((-1.0 * (Math.abs(eh) * (Math.sin(t) * Math.sin(Math.atan((-1.0 * ((Math.abs(eh) * t) / ew))))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if math.fabs(eh) <= 58000000.0: tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((-1.0 * (math.fabs(eh) * (math.sin(t) * math.sin(math.atan((-1.0 * ((math.fabs(eh) * t) / ew)))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (abs(eh) <= 58000000.0) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(-1.0 * Float64(abs(eh) * Float64(sin(t) * sin(atan(Float64(-1.0 * Float64(Float64(abs(eh) * t) / ew)))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (abs(eh) <= 58000000.0) tmp = abs((ew * cos(t))); else tmp = abs((-1.0 * (abs(eh) * (sin(t) * sin(atan((-1.0 * ((abs(eh) * t) / ew)))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[N[Abs[eh], $MachinePrecision], 58000000.0], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(-1.0 * N[(N[Abs[eh], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(-1.0 * N[(N[(N[Abs[eh], $MachinePrecision] * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|eh\right| \leq 58000000:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|-1 \cdot \left(\left|eh\right| \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{\left|eh\right| \cdot t}{ew}\right)\right)\right)\right|\\
\end{array}
if eh < 5.8e7Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.8%
Applied rewrites87.7%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.8%
Applied rewrites61.8%
if 5.8e7 < eh Initial program 99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
Applied rewrites41.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6441.6%
Applied rewrites41.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (- (fabs eh))))
(if (<= (fabs eh) 58000000.0)
(fabs (* ew (cos t)))
(fabs (* (* t_1 (sin t)) (tanh (asinh (* (/ t ew) t_1))))))))double code(double eh, double ew, double t) {
double t_1 = -fabs(eh);
double tmp;
if (fabs(eh) <= 58000000.0) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs(((t_1 * sin(t)) * tanh(asinh(((t / ew) * t_1)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = -math.fabs(eh) tmp = 0 if math.fabs(eh) <= 58000000.0: tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs(((t_1 * math.sin(t)) * math.tanh(math.asinh(((t / ew) * t_1))))) return tmp
function code(eh, ew, t) t_1 = Float64(-abs(eh)) tmp = 0.0 if (abs(eh) <= 58000000.0) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(Float64(t_1 * sin(t)) * tanh(asinh(Float64(Float64(t / ew) * t_1))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = -abs(eh); tmp = 0.0; if (abs(eh) <= 58000000.0) tmp = abs((ew * cos(t))); else tmp = abs(((t_1 * sin(t)) * tanh(asinh(((t / ew) * t_1))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = (-N[Abs[eh], $MachinePrecision])}, If[LessEqual[N[Abs[eh], $MachinePrecision], 58000000.0], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(t$95$1 * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Tanh[N[ArcSinh[N[(N[(t / ew), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_1 := -\left|eh\right|\\
\mathbf{if}\;\left|eh\right| \leq 58000000:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(t\_1 \cdot \sin t\right) \cdot \tanh \sinh^{-1} \left(\frac{t}{ew} \cdot t\_1\right)\right|\\
\end{array}
if eh < 5.8e7Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.8%
Applied rewrites87.7%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.8%
Applied rewrites61.8%
if 5.8e7 < eh Initial program 99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
Applied rewrites41.4%
Applied rewrites20.7%
Taylor expanded in t around 0
lower-/.f6410.8%
Applied rewrites10.8%
Taylor expanded in t around 0
lower-/.f6412.8%
Applied rewrites12.8%
Applied rewrites41.6%
(FPCore (eh ew t) :precision binary64 (if (<= (fabs eh) 3.5e+180) (fabs (* ew (cos t))) (fabs (/ (* (fabs eh) t) (* ew (sqrt (/ 1.0 (pow ew 2.0))))))))
double code(double eh, double ew, double t) {
double tmp;
if (fabs(eh) <= 3.5e+180) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs(((fabs(eh) * t) / (ew * sqrt((1.0 / pow(ew, 2.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(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (abs(eh) <= 3.5d+180) then
tmp = abs((ew * cos(t)))
else
tmp = abs(((abs(eh) * t) / (ew * sqrt((1.0d0 / (ew ** 2.0d0))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (Math.abs(eh) <= 3.5e+180) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs(((Math.abs(eh) * t) / (ew * Math.sqrt((1.0 / Math.pow(ew, 2.0))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if math.fabs(eh) <= 3.5e+180: tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs(((math.fabs(eh) * t) / (ew * math.sqrt((1.0 / math.pow(ew, 2.0)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (abs(eh) <= 3.5e+180) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(Float64(abs(eh) * t) / Float64(ew * sqrt(Float64(1.0 / (ew ^ 2.0)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (abs(eh) <= 3.5e+180) tmp = abs((ew * cos(t))); else tmp = abs(((abs(eh) * t) / (ew * sqrt((1.0 / (ew ^ 2.0)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[N[Abs[eh], $MachinePrecision], 3.5e+180], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Abs[eh], $MachinePrecision] * t), $MachinePrecision] / N[(ew * N[Sqrt[N[(1.0 / N[Power[ew, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|eh\right| \leq 3.5 \cdot 10^{+180}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left|eh\right| \cdot t}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}\right|\\
\end{array}
if eh < 3.4999999999999998e180Initial program 99.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
sin-sumN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower--.f64N/A
Applied rewrites87.8%
Applied rewrites87.7%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.8%
Applied rewrites61.8%
if 3.4999999999999998e180 < eh Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
lower-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
Applied rewrites79.2%
Taylor expanded in eh around inf
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sqrt.f64N/A
Applied rewrites20.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-pow.f6411.6%
Applied rewrites11.6%
(FPCore (eh ew t) :precision binary64 (if (<= (fabs eh) 3.5e+180) (/ (fabs (- ew)) (sqrt 1.0)) (fabs (/ (* (fabs eh) t) (* ew (sqrt (/ 1.0 (pow ew 2.0))))))))
double code(double eh, double ew, double t) {
double tmp;
if (fabs(eh) <= 3.5e+180) {
tmp = fabs(-ew) / sqrt(1.0);
} else {
tmp = fabs(((fabs(eh) * t) / (ew * sqrt((1.0 / pow(ew, 2.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(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (abs(eh) <= 3.5d+180) then
tmp = abs(-ew) / sqrt(1.0d0)
else
tmp = abs(((abs(eh) * t) / (ew * sqrt((1.0d0 / (ew ** 2.0d0))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (Math.abs(eh) <= 3.5e+180) {
tmp = Math.abs(-ew) / Math.sqrt(1.0);
} else {
tmp = Math.abs(((Math.abs(eh) * t) / (ew * Math.sqrt((1.0 / Math.pow(ew, 2.0))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if math.fabs(eh) <= 3.5e+180: tmp = math.fabs(-ew) / math.sqrt(1.0) else: tmp = math.fabs(((math.fabs(eh) * t) / (ew * math.sqrt((1.0 / math.pow(ew, 2.0)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (abs(eh) <= 3.5e+180) tmp = Float64(abs(Float64(-ew)) / sqrt(1.0)); else tmp = abs(Float64(Float64(abs(eh) * t) / Float64(ew * sqrt(Float64(1.0 / (ew ^ 2.0)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (abs(eh) <= 3.5e+180) tmp = abs(-ew) / sqrt(1.0); else tmp = abs(((abs(eh) * t) / (ew * sqrt((1.0 / (ew ^ 2.0)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[N[Abs[eh], $MachinePrecision], 3.5e+180], N[(N[Abs[(-ew)], $MachinePrecision] / N[Sqrt[1.0], $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[(N[Abs[eh], $MachinePrecision] * t), $MachinePrecision] / N[(ew * N[Sqrt[N[(1.0 / N[Power[ew, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|eh\right| \leq 3.5 \cdot 10^{+180}:\\
\;\;\;\;\frac{\left|-ew\right|}{\sqrt{1}}\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left|eh\right| \cdot t}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}\right|\\
\end{array}
if eh < 3.4999999999999998e180Initial program 99.8%
Applied rewrites77.1%
Taylor expanded in t around 0
lower-*.f6441.8%
Applied rewrites41.8%
Taylor expanded in eh around 0
Applied rewrites42.2%
lift-fabs.f64N/A
lift-/.f64N/A
fabs-divN/A
lift-sqrt.f64N/A
sqrt-fabs-revN/A
lift-sqrt.f64N/A
lower-/.f64N/A
Applied rewrites42.2%
if 3.4999999999999998e180 < eh Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
lower-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
Applied rewrites79.2%
Taylor expanded in eh around inf
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sqrt.f64N/A
Applied rewrites20.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-pow.f6411.6%
Applied rewrites11.6%
(FPCore (eh ew t) :precision binary64 (/ (fabs (- ew)) (sqrt 1.0)))
double code(double eh, double ew, double t) {
return fabs(-ew) / sqrt(1.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(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(-ew) / sqrt(1.0d0)
end function
public static double code(double eh, double ew, double t) {
return Math.abs(-ew) / Math.sqrt(1.0);
}
def code(eh, ew, t): return math.fabs(-ew) / math.sqrt(1.0)
function code(eh, ew, t) return Float64(abs(Float64(-ew)) / sqrt(1.0)) end
function tmp = code(eh, ew, t) tmp = abs(-ew) / sqrt(1.0); end
code[eh_, ew_, t_] := N[(N[Abs[(-ew)], $MachinePrecision] / N[Sqrt[1.0], $MachinePrecision]), $MachinePrecision]
\frac{\left|-ew\right|}{\sqrt{1}}
Initial program 99.8%
Applied rewrites77.1%
Taylor expanded in t around 0
lower-*.f6441.8%
Applied rewrites41.8%
Taylor expanded in eh around 0
Applied rewrites42.2%
lift-fabs.f64N/A
lift-/.f64N/A
fabs-divN/A
lift-sqrt.f64N/A
sqrt-fabs-revN/A
lift-sqrt.f64N/A
lower-/.f64N/A
Applied rewrites42.2%
herbie shell --seed 2025207
(FPCore (eh ew t)
:name "Example 2 from Robby"
:precision binary64
(fabs (- (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))