
(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 15 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 (- (* (* ew (cos t)) (cos (atan (/ (* (tan t) eh) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))
double code(double eh, double ew, double t) {
return fabs((((ew * cos(t)) * cos(atan(((tan(t) * eh) / 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((((ew * cos(t)) * cos(atan(((tan(t) * eh) / 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((((ew * Math.cos(t)) * Math.cos(Math.atan(((Math.tan(t) * eh) / ew)))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((-eh * Math.tan(t)) / ew))))));
}
def code(eh, ew, t): return math.fabs((((ew * math.cos(t)) * math.cos(math.atan(((math.tan(t) * eh) / ew)))) - ((eh * math.sin(t)) * math.sin(math.atan(((-eh * math.tan(t)) / ew))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(atan(Float64(Float64(tan(t) * eh) / ew)))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs((((ew * cos(t)) * cos(atan(((tan(t) * eh) / ew)))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision]], $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|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\tan t \cdot eh}{ew}\right) - \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-cos.f64N/A
cos-neg-revN/A
lower-cos.f64N/A
lift-atan.f64N/A
atan-neg-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-atan.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f6499.8%
Applied rewrites99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (* (tan t) eh) ew)))
(fabs
(+
(* (/ (cos t) (sqrt (- (pow t_1 2.0) -1.0))) ew)
(* (sin (atan t_1)) (* (sin t) eh))))))double code(double eh, double ew, double t) {
double t_1 = (tan(t) * eh) / ew;
return fabs((((cos(t) / sqrt((pow(t_1, 2.0) - -1.0))) * ew) + (sin(atan(t_1)) * (sin(t) * eh))));
}
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 = (tan(t) * eh) / ew
code = abs((((cos(t) / sqrt(((t_1 ** 2.0d0) - (-1.0d0)))) * ew) + (sin(atan(t_1)) * (sin(t) * eh))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = (Math.tan(t) * eh) / ew;
return Math.abs((((Math.cos(t) / Math.sqrt((Math.pow(t_1, 2.0) - -1.0))) * ew) + (Math.sin(Math.atan(t_1)) * (Math.sin(t) * eh))));
}
def code(eh, ew, t): t_1 = (math.tan(t) * eh) / ew return math.fabs((((math.cos(t) / math.sqrt((math.pow(t_1, 2.0) - -1.0))) * ew) + (math.sin(math.atan(t_1)) * (math.sin(t) * eh))))
function code(eh, ew, t) t_1 = Float64(Float64(tan(t) * eh) / ew) return abs(Float64(Float64(Float64(cos(t) / sqrt(Float64((t_1 ^ 2.0) - -1.0))) * ew) + Float64(sin(atan(t_1)) * Float64(sin(t) * eh)))) end
function tmp = code(eh, ew, t) t_1 = (tan(t) * eh) / ew; tmp = abs((((cos(t) / sqrt(((t_1 ^ 2.0) - -1.0))) * ew) + (sin(atan(t_1)) * (sin(t) * eh)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision]}, N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[Power[t$95$1, 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision] + N[(N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_1 := \frac{\tan t \cdot eh}{ew}\\
\left|\frac{\cos t}{\sqrt{{t\_1}^{2} - -1}} \cdot ew + \sin \tan^{-1} t\_1 \cdot \left(\sin t \cdot eh\right)\right|
\end{array}
Initial program 99.8%
Applied rewrites99.8%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (cos t) ew) (* (sin (atan (/ (* (tan t) eh) ew))) (* (sin t) eh)))))
double code(double eh, double ew, double t) {
return fabs(((cos(t) * ew) + (sin(atan(((tan(t) * eh) / ew))) * (sin(t) * eh))));
}
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(((cos(t) * ew) + (sin(atan(((tan(t) * eh) / ew))) * (sin(t) * eh))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((Math.cos(t) * ew) + (Math.sin(Math.atan(((Math.tan(t) * eh) / ew))) * (Math.sin(t) * eh))));
}
def code(eh, ew, t): return math.fabs(((math.cos(t) * ew) + (math.sin(math.atan(((math.tan(t) * eh) / ew))) * (math.sin(t) * eh))))
function code(eh, ew, t) return abs(Float64(Float64(cos(t) * ew) + Float64(sin(atan(Float64(Float64(tan(t) * eh) / ew))) * Float64(sin(t) * eh)))) end
function tmp = code(eh, ew, t) tmp = abs(((cos(t) * ew) + (sin(atan(((tan(t) * eh) / ew))) * (sin(t) * eh)))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] + N[(N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\cos t \cdot ew + \sin \tan^{-1} \left(\frac{\tan t \cdot eh}{ew}\right) \cdot \left(\sin t \cdot eh\right)\right|
Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-cos.f6498.4%
Applied rewrites98.4%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (cos t) ew) (* (sin (atan (/ (* eh t) ew))) (* (sin t) eh)))))
double code(double eh, double ew, double t) {
return fabs(((cos(t) * ew) + (sin(atan(((eh * t) / ew))) * (sin(t) * eh))));
}
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(((cos(t) * ew) + (sin(atan(((eh * t) / ew))) * (sin(t) * eh))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((Math.cos(t) * ew) + (Math.sin(Math.atan(((eh * t) / ew))) * (Math.sin(t) * eh))));
}
def code(eh, ew, t): return math.fabs(((math.cos(t) * ew) + (math.sin(math.atan(((eh * t) / ew))) * (math.sin(t) * eh))))
function code(eh, ew, t) return abs(Float64(Float64(cos(t) * ew) + Float64(sin(atan(Float64(Float64(eh * t) / ew))) * Float64(sin(t) * eh)))) end
function tmp = code(eh, ew, t) tmp = abs(((cos(t) * ew) + (sin(atan(((eh * t) / ew))) * (sin(t) * eh)))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] + N[(N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\cos t \cdot ew + \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \left(\sin t \cdot eh\right)\right|
Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in t around 0
lower-*.f6489.1%
Applied rewrites89.1%
Taylor expanded in t around 0
lower-*.f6489.3%
Applied rewrites89.3%
Taylor expanded in eh around 0
lower-cos.f6498.1%
Applied rewrites98.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (fabs t))))
(if (<= (fabs t) 2.2e-5)
(fabs
(+
ew
(*
eh
(*
(fabs t)
(sin (atan (/ (* eh t_1) (* ew (cos (fabs t))))))))))
(fabs
(* (* (- eh) (tanh (asinh (* (/ (fabs t) ew) (- eh))))) t_1)))))double code(double eh, double ew, double t) {
double t_1 = sin(fabs(t));
double tmp;
if (fabs(t) <= 2.2e-5) {
tmp = fabs((ew + (eh * (fabs(t) * sin(atan(((eh * t_1) / (ew * cos(fabs(t))))))))));
} else {
tmp = fabs(((-eh * tanh(asinh(((fabs(t) / ew) * -eh)))) * t_1));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(math.fabs(t)) tmp = 0 if math.fabs(t) <= 2.2e-5: tmp = math.fabs((ew + (eh * (math.fabs(t) * math.sin(math.atan(((eh * t_1) / (ew * math.cos(math.fabs(t)))))))))) else: tmp = math.fabs(((-eh * math.tanh(math.asinh(((math.fabs(t) / ew) * -eh)))) * t_1)) return tmp
function code(eh, ew, t) t_1 = sin(abs(t)) tmp = 0.0 if (abs(t) <= 2.2e-5) tmp = abs(Float64(ew + Float64(eh * Float64(abs(t) * sin(atan(Float64(Float64(eh * t_1) / Float64(ew * cos(abs(t)))))))))); else tmp = abs(Float64(Float64(Float64(-eh) * tanh(asinh(Float64(Float64(abs(t) / ew) * Float64(-eh))))) * t_1)); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(abs(t)); tmp = 0.0; if (abs(t) <= 2.2e-5) tmp = abs((ew + (eh * (abs(t) * sin(atan(((eh * t_1) / (ew * cos(abs(t)))))))))); else tmp = abs(((-eh * tanh(asinh(((abs(t) / ew) * -eh)))) * t_1)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 2.2e-5], N[Abs[N[(ew + N[(eh * N[(N[Abs[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t$95$1), $MachinePrecision] / N[(ew * N[Cos[N[Abs[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[((-eh) * N[Tanh[N[ArcSinh[N[(N[(N[Abs[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_1 := \sin \left(\left|t\right|\right)\\
\mathbf{if}\;\left|t\right| \leq 2.2 \cdot 10^{-5}:\\
\;\;\;\;\left|ew + eh \cdot \left(\left|t\right| \cdot \sin \tan^{-1} \left(\frac{eh \cdot t\_1}{ew \cdot \cos \left(\left|t\right|\right)}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{\left|t\right|}{ew} \cdot \left(-eh\right)\right)\right) \cdot t\_1\right|\\
\end{array}
if t < 2.1999999999999999e-5Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f6454.9%
Applied rewrites54.9%
if 2.1999999999999999e-5 < t 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 rewrites41.4%
Taylor expanded in t around 0
lower-/.f6441.6%
Applied rewrites41.6%
(FPCore (eh ew t)
:precision binary64
(if (<= (fabs ew) 9.2e-82)
(fabs
(* (* (- eh) (tanh (asinh (* (/ t (fabs ew)) (- eh))))) (sin t)))
(fabs
(+
(*
(/ (cos t) (sqrt (- (pow (/ (* eh t) (fabs ew)) 2.0) -1.0)))
(fabs ew))
(*
(*
(/
(* eh t)
(*
(fabs ew)
(sqrt
(- (/ (* (* eh t) (* eh t)) (* (fabs ew) (fabs ew))) -1.0))))
(sin t))
eh)))))double code(double eh, double ew, double t) {
double tmp;
if (fabs(ew) <= 9.2e-82) {
tmp = fabs(((-eh * tanh(asinh(((t / fabs(ew)) * -eh)))) * sin(t)));
} else {
tmp = fabs((((cos(t) / sqrt((pow(((eh * t) / fabs(ew)), 2.0) - -1.0))) * fabs(ew)) + ((((eh * t) / (fabs(ew) * sqrt(((((eh * t) * (eh * t)) / (fabs(ew) * fabs(ew))) - -1.0)))) * sin(t)) * eh)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if math.fabs(ew) <= 9.2e-82: tmp = math.fabs(((-eh * math.tanh(math.asinh(((t / math.fabs(ew)) * -eh)))) * math.sin(t))) else: tmp = math.fabs((((math.cos(t) / math.sqrt((math.pow(((eh * t) / math.fabs(ew)), 2.0) - -1.0))) * math.fabs(ew)) + ((((eh * t) / (math.fabs(ew) * math.sqrt(((((eh * t) * (eh * t)) / (math.fabs(ew) * math.fabs(ew))) - -1.0)))) * math.sin(t)) * eh))) return tmp
function code(eh, ew, t) tmp = 0.0 if (abs(ew) <= 9.2e-82) tmp = abs(Float64(Float64(Float64(-eh) * tanh(asinh(Float64(Float64(t / abs(ew)) * Float64(-eh))))) * sin(t))); else tmp = abs(Float64(Float64(Float64(cos(t) / sqrt(Float64((Float64(Float64(eh * t) / abs(ew)) ^ 2.0) - -1.0))) * abs(ew)) + Float64(Float64(Float64(Float64(eh * t) / Float64(abs(ew) * sqrt(Float64(Float64(Float64(Float64(eh * t) * Float64(eh * t)) / Float64(abs(ew) * abs(ew))) - -1.0)))) * sin(t)) * eh))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (abs(ew) <= 9.2e-82) tmp = abs(((-eh * tanh(asinh(((t / abs(ew)) * -eh)))) * sin(t))); else tmp = abs((((cos(t) / sqrt(((((eh * t) / abs(ew)) ^ 2.0) - -1.0))) * abs(ew)) + ((((eh * t) / (abs(ew) * sqrt(((((eh * t) * (eh * t)) / (abs(ew) * abs(ew))) - -1.0)))) * sin(t)) * eh))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[N[Abs[ew], $MachinePrecision], 9.2e-82], N[Abs[N[(N[((-eh) * N[Tanh[N[ArcSinh[N[(N[(t / N[Abs[ew], $MachinePrecision]), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(eh * t), $MachinePrecision] / N[Abs[ew], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Abs[ew], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(eh * t), $MachinePrecision] / N[(N[Abs[ew], $MachinePrecision] * N[Sqrt[N[(N[(N[(N[(eh * t), $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision] / N[(N[Abs[ew], $MachinePrecision] * N[Abs[ew], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|ew\right| \leq 9.2 \cdot 10^{-82}:\\
\;\;\;\;\left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{t}{\left|ew\right|} \cdot \left(-eh\right)\right)\right) \cdot \sin t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\cos t}{\sqrt{{\left(\frac{eh \cdot t}{\left|ew\right|}\right)}^{2} - -1}} \cdot \left|ew\right| + \left(\frac{eh \cdot t}{\left|ew\right| \cdot \sqrt{\frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{\left|ew\right| \cdot \left|ew\right|} - -1}} \cdot \sin t\right) \cdot eh\right|\\
\end{array}
if ew < 9.1999999999999999e-82Initial 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 rewrites41.4%
Taylor expanded in t around 0
lower-/.f6441.6%
Applied rewrites41.6%
if 9.1999999999999999e-82 < ew Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in t around 0
lower-*.f6489.1%
Applied rewrites89.1%
Taylor expanded in t around 0
lower-*.f6489.3%
Applied rewrites89.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites48.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(sqrt
(- (/ (* (* eh t) (* eh t)) (* (fabs ew) (fabs ew))) -1.0))))
(if (<= (fabs ew) 9.2e-82)
(fabs
(* (* (- eh) (tanh (asinh (* (/ t (fabs ew)) (- eh))))) (sin t)))
(fabs
(+
(/ (* (cos t) (fabs ew)) t_1)
(* (/ (* eh t) (* (fabs ew) t_1)) (* eh (sin t))))))))double code(double eh, double ew, double t) {
double t_1 = sqrt(((((eh * t) * (eh * t)) / (fabs(ew) * fabs(ew))) - -1.0));
double tmp;
if (fabs(ew) <= 9.2e-82) {
tmp = fabs(((-eh * tanh(asinh(((t / fabs(ew)) * -eh)))) * sin(t)));
} else {
tmp = fabs((((cos(t) * fabs(ew)) / t_1) + (((eh * t) / (fabs(ew) * t_1)) * (eh * sin(t)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sqrt(((((eh * t) * (eh * t)) / (math.fabs(ew) * math.fabs(ew))) - -1.0)) tmp = 0 if math.fabs(ew) <= 9.2e-82: tmp = math.fabs(((-eh * math.tanh(math.asinh(((t / math.fabs(ew)) * -eh)))) * math.sin(t))) else: tmp = math.fabs((((math.cos(t) * math.fabs(ew)) / t_1) + (((eh * t) / (math.fabs(ew) * t_1)) * (eh * math.sin(t))))) return tmp
function code(eh, ew, t) t_1 = sqrt(Float64(Float64(Float64(Float64(eh * t) * Float64(eh * t)) / Float64(abs(ew) * abs(ew))) - -1.0)) tmp = 0.0 if (abs(ew) <= 9.2e-82) tmp = abs(Float64(Float64(Float64(-eh) * tanh(asinh(Float64(Float64(t / abs(ew)) * Float64(-eh))))) * sin(t))); else tmp = abs(Float64(Float64(Float64(cos(t) * abs(ew)) / t_1) + Float64(Float64(Float64(eh * t) / Float64(abs(ew) * t_1)) * Float64(eh * sin(t))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sqrt(((((eh * t) * (eh * t)) / (abs(ew) * abs(ew))) - -1.0)); tmp = 0.0; if (abs(ew) <= 9.2e-82) tmp = abs(((-eh * tanh(asinh(((t / abs(ew)) * -eh)))) * sin(t))); else tmp = abs((((cos(t) * abs(ew)) / t_1) + (((eh * t) / (abs(ew) * t_1)) * (eh * sin(t))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(N[(eh * t), $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision] / N[(N[Abs[ew], $MachinePrecision] * N[Abs[ew], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[ew], $MachinePrecision], 9.2e-82], N[Abs[N[(N[((-eh) * N[Tanh[N[ArcSinh[N[(N[(t / N[Abs[ew], $MachinePrecision]), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] * N[Abs[ew], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(N[(eh * t), $MachinePrecision] / N[(N[Abs[ew], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_1 := \sqrt{\frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{\left|ew\right| \cdot \left|ew\right|} - -1}\\
\mathbf{if}\;\left|ew\right| \leq 9.2 \cdot 10^{-82}:\\
\;\;\;\;\left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{t}{\left|ew\right|} \cdot \left(-eh\right)\right)\right) \cdot \sin t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\cos t \cdot \left|ew\right|}{t\_1} + \frac{eh \cdot t}{\left|ew\right| \cdot t\_1} \cdot \left(eh \cdot \sin t\right)\right|\\
\end{array}
if ew < 9.1999999999999999e-82Initial 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 rewrites41.4%
Taylor expanded in t around 0
lower-/.f6441.6%
Applied rewrites41.6%
if 9.1999999999999999e-82 < ew Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in t around 0
lower-*.f6489.1%
Applied rewrites89.1%
Taylor expanded in t around 0
lower-*.f6489.3%
Applied rewrites89.3%
Applied rewrites48.3%
(FPCore (eh ew t)
:precision binary64
(if (<= (fabs t) 2.2e-5)
(fabs (* ew (cos (atan (* -1.0 (/ (* eh (fabs t)) ew))))))
(fabs
(*
(* (- eh) (tanh (asinh (* (/ (fabs t) ew) (- eh)))))
(sin (fabs t))))))double code(double eh, double ew, double t) {
double tmp;
if (fabs(t) <= 2.2e-5) {
tmp = fabs((ew * cos(atan((-1.0 * ((eh * fabs(t)) / ew))))));
} else {
tmp = fabs(((-eh * tanh(asinh(((fabs(t) / ew) * -eh)))) * sin(fabs(t))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if math.fabs(t) <= 2.2e-5: tmp = math.fabs((ew * math.cos(math.atan((-1.0 * ((eh * math.fabs(t)) / ew)))))) else: tmp = math.fabs(((-eh * math.tanh(math.asinh(((math.fabs(t) / ew) * -eh)))) * math.sin(math.fabs(t)))) return tmp
function code(eh, ew, t) tmp = 0.0 if (abs(t) <= 2.2e-5) tmp = abs(Float64(ew * cos(atan(Float64(-1.0 * Float64(Float64(eh * abs(t)) / ew)))))); else tmp = abs(Float64(Float64(Float64(-eh) * tanh(asinh(Float64(Float64(abs(t) / ew) * Float64(-eh))))) * sin(abs(t)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (abs(t) <= 2.2e-5) tmp = abs((ew * cos(atan((-1.0 * ((eh * abs(t)) / ew)))))); else tmp = abs(((-eh * tanh(asinh(((abs(t) / ew) * -eh)))) * sin(abs(t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[N[Abs[t], $MachinePrecision], 2.2e-5], N[Abs[N[(ew * N[Cos[N[ArcTan[N[(-1.0 * N[(N[(eh * N[Abs[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[((-eh) * N[Tanh[N[ArcSinh[N[(N[(N[Abs[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 2.2 \cdot 10^{-5}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \left|t\right|}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{\left|t\right|}{ew} \cdot \left(-eh\right)\right)\right) \cdot \sin \left(\left|t\right|\right)\right|\\
\end{array}
if t < 2.1999999999999999e-5Initial 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-cos.f64N/A
lower-atan.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f6441.9%
Applied rewrites41.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6440.6%
Applied rewrites40.6%
if 2.1999999999999999e-5 < t 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 rewrites41.4%
Taylor expanded in t around 0
lower-/.f6441.6%
Applied rewrites41.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (- 0.5 (* 0.5 (cos (* 2.0 (fabs t)))))))
(if (<= (fabs t) 2.2e-5)
(fabs (* ew (cos (atan (* -1.0 (/ (* eh (fabs t)) ew))))))
(fabs
(/
(* t_1 eh)
(* (* 1.0 ew) (/ (sqrt (/ t_1 (* ew ew))) (fabs 1.0))))))))double code(double eh, double ew, double t) {
double t_1 = 0.5 - (0.5 * cos((2.0 * fabs(t))));
double tmp;
if (fabs(t) <= 2.2e-5) {
tmp = fabs((ew * cos(atan((-1.0 * ((eh * fabs(t)) / ew))))));
} else {
tmp = fabs(((t_1 * eh) / ((1.0 * ew) * (sqrt((t_1 / (ew * ew))) / fabs(1.0)))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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
real(8) :: tmp
t_1 = 0.5d0 - (0.5d0 * cos((2.0d0 * abs(t))))
if (abs(t) <= 2.2d-5) then
tmp = abs((ew * cos(atan(((-1.0d0) * ((eh * abs(t)) / ew))))))
else
tmp = abs(((t_1 * eh) / ((1.0d0 * ew) * (sqrt((t_1 / (ew * ew))) / abs(1.0d0)))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = 0.5 - (0.5 * Math.cos((2.0 * Math.abs(t))));
double tmp;
if (Math.abs(t) <= 2.2e-5) {
tmp = Math.abs((ew * Math.cos(Math.atan((-1.0 * ((eh * Math.abs(t)) / ew))))));
} else {
tmp = Math.abs(((t_1 * eh) / ((1.0 * ew) * (Math.sqrt((t_1 / (ew * ew))) / Math.abs(1.0)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = 0.5 - (0.5 * math.cos((2.0 * math.fabs(t)))) tmp = 0 if math.fabs(t) <= 2.2e-5: tmp = math.fabs((ew * math.cos(math.atan((-1.0 * ((eh * math.fabs(t)) / ew)))))) else: tmp = math.fabs(((t_1 * eh) / ((1.0 * ew) * (math.sqrt((t_1 / (ew * ew))) / math.fabs(1.0))))) return tmp
function code(eh, ew, t) t_1 = Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * abs(t))))) tmp = 0.0 if (abs(t) <= 2.2e-5) tmp = abs(Float64(ew * cos(atan(Float64(-1.0 * Float64(Float64(eh * abs(t)) / ew)))))); else tmp = abs(Float64(Float64(t_1 * eh) / Float64(Float64(1.0 * ew) * Float64(sqrt(Float64(t_1 / Float64(ew * ew))) / abs(1.0))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = 0.5 - (0.5 * cos((2.0 * abs(t)))); tmp = 0.0; if (abs(t) <= 2.2e-5) tmp = abs((ew * cos(atan((-1.0 * ((eh * abs(t)) / ew)))))); else tmp = abs(((t_1 * eh) / ((1.0 * ew) * (sqrt((t_1 / (ew * ew))) / abs(1.0))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[Abs[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 2.2e-5], N[Abs[N[(ew * N[Cos[N[ArcTan[N[(-1.0 * N[(N[(eh * N[Abs[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(t$95$1 * eh), $MachinePrecision] / N[(N[(1.0 * ew), $MachinePrecision] * N[(N[Sqrt[N[(t$95$1 / N[(ew * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Abs[1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_1 := 0.5 - 0.5 \cdot \cos \left(2 \cdot \left|t\right|\right)\\
\mathbf{if}\;\left|t\right| \leq 2.2 \cdot 10^{-5}:\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \left|t\right|}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{t\_1 \cdot eh}{\left(1 \cdot ew\right) \cdot \frac{\sqrt{\frac{t\_1}{ew \cdot ew}}}{\left|1\right|}}\right|\\
\end{array}
if t < 2.1999999999999999e-5Initial 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-cos.f64N/A
lower-atan.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f6441.9%
Applied rewrites41.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6440.6%
Applied rewrites40.6%
if 2.1999999999999999e-5 < t Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
lift-/.f64N/A
frac-2negN/A
associate-/l/N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites79.3%
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 rewrites19.8%
Applied rewrites14.6%
Taylor expanded in t around 0
Applied rewrites5.0%
Taylor expanded in t around 0
Applied rewrites14.6%
(FPCore (eh ew t) :precision binary64 (fabs (/ ew (sqrt (- (pow (/ (* (tan t) eh) ew) 2.0) -1.0)))))
double code(double eh, double ew, double t) {
return fabs((ew / sqrt((pow(((tan(t) * eh) / ew), 2.0) - -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(((((tan(t) * eh) / ew) ** 2.0d0) - (-1.0d0)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew / Math.sqrt((Math.pow(((Math.tan(t) * eh) / ew), 2.0) - -1.0))));
}
def code(eh, ew, t): return math.fabs((ew / math.sqrt((math.pow(((math.tan(t) * eh) / ew), 2.0) - -1.0))))
function code(eh, ew, t) return abs(Float64(ew / sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) - -1.0)))) end
function tmp = code(eh, ew, t) tmp = abs((ew / sqrt(((((tan(t) * eh) / ew) ^ 2.0) - -1.0)))); end
code[eh_, ew_, t_] := N[Abs[N[(ew / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\frac{ew}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} - -1}}\right|
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-cos.f64N/A
lower-atan.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f6441.9%
Applied rewrites41.9%
Applied rewrites41.6%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos (atan (* -1.0 (/ (* eh t) ew)))))))
double code(double eh, double ew, double t) {
return fabs((ew * cos(atan((-1.0 * ((eh * 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((ew * cos(atan(((-1.0d0) * ((eh * t) / ew))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.cos(Math.atan((-1.0 * ((eh * t) / ew))))));
}
def code(eh, ew, t): return math.fabs((ew * math.cos(math.atan((-1.0 * ((eh * t) / ew))))))
function code(eh, ew, t) return abs(Float64(ew * cos(atan(Float64(-1.0 * Float64(Float64(eh * t) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * cos(atan((-1.0 * ((eh * t) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[N[ArcTan[N[(-1.0 * N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot t}{ew}\right)\right|
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-cos.f64N/A
lower-atan.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f6441.9%
Applied rewrites41.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6440.6%
Applied rewrites40.6%
(FPCore (eh ew t) :precision binary64 (fabs (/ (* eh t) (* ew (sqrt (/ 1.0 (pow ew 2.0)))))))
double code(double eh, double ew, double t) {
return fabs(((eh * t) / (ew * sqrt((1.0 / pow(ew, 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(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((eh * t) / (ew * sqrt((1.0d0 / (ew ** 2.0d0))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((eh * t) / (ew * Math.sqrt((1.0 / Math.pow(ew, 2.0))))));
}
def code(eh, ew, t): return math.fabs(((eh * t) / (ew * math.sqrt((1.0 / math.pow(ew, 2.0))))))
function code(eh, ew, t) return abs(Float64(Float64(eh * t) / Float64(ew * sqrt(Float64(1.0 / (ew ^ 2.0)))))) end
function tmp = code(eh, ew, t) tmp = abs(((eh * t) / (ew * sqrt((1.0 / (ew ^ 2.0)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(eh * t), $MachinePrecision] / N[(ew * N[Sqrt[N[(1.0 / N[Power[ew, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\frac{eh \cdot t}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}\right|
Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
lift-/.f64N/A
frac-2negN/A
associate-/l/N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites79.3%
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 rewrites19.8%
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.2%
Applied rewrites11.2%
(FPCore (eh ew t) :precision binary64 (fabs (* -1.0 (* eh (* -1.0 (/ (* (* eh t) t) ew))))))
double code(double eh, double ew, double t) {
return fabs((-1.0 * (eh * (-1.0 * (((eh * t) * 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) * (eh * ((-1.0d0) * (((eh * t) * t) / ew)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((-1.0 * (eh * (-1.0 * (((eh * t) * t) / ew)))));
}
def code(eh, ew, t): return math.fabs((-1.0 * (eh * (-1.0 * (((eh * t) * t) / ew)))))
function code(eh, ew, t) return abs(Float64(-1.0 * Float64(eh * Float64(-1.0 * Float64(Float64(Float64(eh * t) * t) / ew))))) end
function tmp = code(eh, ew, t) tmp = abs((-1.0 * (eh * (-1.0 * (((eh * t) * t) / ew))))); end
code[eh_, ew_, t_] := N[Abs[N[(-1.0 * N[(eh * N[(-1.0 * N[(N[(N[(eh * t), $MachinePrecision] * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|-1 \cdot \left(eh \cdot \left(-1 \cdot \frac{\left(eh \cdot t\right) \cdot t}{ew}\right)\right)\right|
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 rewrites19.0%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f644.5%
Applied rewrites4.5%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f644.6%
Applied rewrites4.6%
(FPCore (eh ew t) :precision binary64 (fabs (* -1.0 (* eh (/ (* (* t t) (- eh)) ew)))))
double code(double eh, double ew, double t) {
return fabs((-1.0 * (eh * (((t * t) * -eh) / 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) * (eh * (((t * t) * -eh) / ew))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((-1.0 * (eh * (((t * t) * -eh) / ew))));
}
def code(eh, ew, t): return math.fabs((-1.0 * (eh * (((t * t) * -eh) / ew))))
function code(eh, ew, t) return abs(Float64(-1.0 * Float64(eh * Float64(Float64(Float64(t * t) * Float64(-eh)) / ew)))) end
function tmp = code(eh, ew, t) tmp = abs((-1.0 * (eh * (((t * t) * -eh) / ew)))); end
code[eh_, ew_, t_] := N[Abs[N[(-1.0 * N[(eh * N[(N[(N[(t * t), $MachinePrecision] * (-eh)), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|-1 \cdot \left(eh \cdot \frac{\left(t \cdot t\right) \cdot \left(-eh\right)}{ew}\right)\right|
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 rewrites19.0%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f644.5%
Applied rewrites4.5%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lift-neg.f64N/A
lower-*.f644.5%
lift-pow.f64N/A
unpow2N/A
lower-*.f644.5%
Applied rewrites4.5%
(FPCore (eh ew t) :precision binary64 (fabs (* (- (* (- eh) (/ (* t t) ew))) eh)))
double code(double eh, double ew, double t) {
return fabs((-(-eh * ((t * t) / ew)) * eh));
}
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((-(-eh * ((t * t) / ew)) * eh))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((-(-eh * ((t * t) / ew)) * eh));
}
def code(eh, ew, t): return math.fabs((-(-eh * ((t * t) / ew)) * eh))
function code(eh, ew, t) return abs(Float64(Float64(-Float64(Float64(-eh) * Float64(Float64(t * t) / ew))) * eh)) end
function tmp = code(eh, ew, t) tmp = abs((-(-eh * ((t * t) / ew)) * eh)); end
code[eh_, ew_, t_] := N[Abs[N[((-N[((-eh) * N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]) * eh), $MachinePrecision]], $MachinePrecision]
\left|\left(-\left(-eh\right) \cdot \frac{t \cdot t}{ew}\right) \cdot eh\right|
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 rewrites19.0%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f644.5%
Applied rewrites4.5%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites4.4%
herbie shell --seed 2025258
(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)))))))