
(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))));
}
real(8) function code(eh, ew, t)
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}
\\
\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}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 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))));
}
real(8) function code(eh, ew, t)
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}
\\
\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}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (tan t) eh) (- ew))))) (fabs (- (* (sin t_1) (* (sin t) eh)) (* (cos t_1) (* (cos t) ew))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((tan(t) * eh) / -ew));
return fabs(((sin(t_1) * (sin(t) * eh)) - (cos(t_1) * (cos(t) * ew))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((tan(t) * eh) / -ew))
code = abs(((sin(t_1) * (sin(t) * eh)) - (cos(t_1) * (cos(t) * ew))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((Math.tan(t) * eh) / -ew));
return Math.abs(((Math.sin(t_1) * (Math.sin(t) * eh)) - (Math.cos(t_1) * (Math.cos(t) * ew))));
}
def code(eh, ew, t): t_1 = math.atan(((math.tan(t) * eh) / -ew)) return math.fabs(((math.sin(t_1) * (math.sin(t) * eh)) - (math.cos(t_1) * (math.cos(t) * ew))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(tan(t) * eh) / Float64(-ew))) return abs(Float64(Float64(sin(t_1) * Float64(sin(t) * eh)) - Float64(cos(t_1) * Float64(cos(t) * ew)))) end
function tmp = code(eh, ew, t) t_1 = atan(((tan(t) * eh) / -ew)); tmp = abs(((sin(t_1) * (sin(t) * eh)) - (cos(t_1) * (cos(t) * ew)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] - N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\tan t \cdot eh}{-ew}\right)\\
\left|\sin t\_1 \cdot \left(\sin t \cdot eh\right) - \cos t\_1 \cdot \left(\cos t \cdot ew\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) ew)) (t_2 (atan (/ (* (tan t) eh) (- ew)))))
(if (<= (- (* (cos t_2) t_1) (* (sin t_2) (* (sin t) eh))) -1e-281)
(fabs (/ ew 1.0))
t_1)))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * ew;
double t_2 = atan(((tan(t) * eh) / -ew));
double tmp;
if (((cos(t_2) * t_1) - (sin(t_2) * (sin(t) * eh))) <= -1e-281) {
tmp = fabs((ew / 1.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = cos(t) * ew
t_2 = atan(((tan(t) * eh) / -ew))
if (((cos(t_2) * t_1) - (sin(t_2) * (sin(t) * eh))) <= (-1d-281)) then
tmp = abs((ew / 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.cos(t) * ew;
double t_2 = Math.atan(((Math.tan(t) * eh) / -ew));
double tmp;
if (((Math.cos(t_2) * t_1) - (Math.sin(t_2) * (Math.sin(t) * eh))) <= -1e-281) {
tmp = Math.abs((ew / 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.cos(t) * ew t_2 = math.atan(((math.tan(t) * eh) / -ew)) tmp = 0 if ((math.cos(t_2) * t_1) - (math.sin(t_2) * (math.sin(t) * eh))) <= -1e-281: tmp = math.fabs((ew / 1.0)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = Float64(cos(t) * ew) t_2 = atan(Float64(Float64(tan(t) * eh) / Float64(-ew))) tmp = 0.0 if (Float64(Float64(cos(t_2) * t_1) - Float64(sin(t_2) * Float64(sin(t) * eh))) <= -1e-281) tmp = abs(Float64(ew / 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = cos(t) * ew; t_2 = atan(((tan(t) * eh) / -ew)); tmp = 0.0; if (((cos(t_2) * t_1) - (sin(t_2) * (sin(t) * eh))) <= -1e-281) tmp = abs((ew / 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[Cos[t$95$2], $MachinePrecision] * t$95$1), $MachinePrecision] - N[(N[Sin[t$95$2], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-281], N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot ew\\
t_2 := \tan^{-1} \left(\frac{\tan t \cdot eh}{-ew}\right)\\
\mathbf{if}\;\cos t\_2 \cdot t\_1 - \sin t\_2 \cdot \left(\sin t \cdot eh\right) \leq -1 \cdot 10^{-281}:\\
\;\;\;\;\left|\frac{ew}{1}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\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-281Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites41.2%
Taylor expanded in t around 0
Applied rewrites40.3%
Applied rewrites39.4%
Taylor expanded in ew around inf
Applied rewrites41.4%
if -1e-281 < (-.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%
Applied rewrites99.6%
Applied rewrites79.6%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6466.5
Applied rewrites66.5%
Final simplification55.2%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (sin (atan (/ (* (- eh) t) ew))) (* (sin t) eh)) (* (cos (atan (/ (* (tan t) eh) (- ew)))) (* (cos t) ew)))))
double code(double eh, double ew, double t) {
return fabs(((sin(atan(((-eh * t) / ew))) * (sin(t) * eh)) - (cos(atan(((tan(t) * eh) / -ew))) * (cos(t) * ew))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(((sin(atan(((-eh * t) / ew))) * (sin(t) * eh)) - (cos(atan(((tan(t) * eh) / -ew))) * (cos(t) * ew))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((Math.sin(Math.atan(((-eh * t) / ew))) * (Math.sin(t) * eh)) - (Math.cos(Math.atan(((Math.tan(t) * eh) / -ew))) * (Math.cos(t) * ew))));
}
def code(eh, ew, t): return math.fabs(((math.sin(math.atan(((-eh * t) / ew))) * (math.sin(t) * eh)) - (math.cos(math.atan(((math.tan(t) * eh) / -ew))) * (math.cos(t) * ew))))
function code(eh, ew, t) return abs(Float64(Float64(sin(atan(Float64(Float64(Float64(-eh) * t) / ew))) * Float64(sin(t) * eh)) - Float64(cos(atan(Float64(Float64(tan(t) * eh) / Float64(-ew)))) * Float64(cos(t) * ew)))) end
function tmp = code(eh, ew, t) tmp = abs(((sin(atan(((-eh * t) / ew))) * (sin(t) * eh)) - (cos(atan(((tan(t) * eh) / -ew))) * (cos(t) * ew)))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Sin[N[ArcTan[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] - N[(N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right) \cdot \left(\sin t \cdot eh\right) - \cos \tan^{-1} \left(\frac{\tan t \cdot eh}{-ew}\right) \cdot \left(\cos t \cdot ew\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.2
Applied rewrites99.2%
Final simplification99.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh))
(t_2 (* (cos t) ew))
(t_3
(fabs
(-
(* (sin (atan (/ (* (- eh) t) ew))) t_1)
(* (cos (atan (* (- t) (/ eh ew)))) t_2)))))
(if (<= eh -60000.0)
t_3
(if (<= eh 1.04e-22)
(/
1.0
(fabs
(/
-1.0
(/
(+ (* (* (/ eh ew) (tan t)) t_1) t_2)
(sqrt (+ 1.0 (pow (* (/ (tan t) ew) eh) 2.0)))))))
t_3))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double t_2 = cos(t) * ew;
double t_3 = fabs(((sin(atan(((-eh * t) / ew))) * t_1) - (cos(atan((-t * (eh / ew)))) * t_2)));
double tmp;
if (eh <= -60000.0) {
tmp = t_3;
} else if (eh <= 1.04e-22) {
tmp = 1.0 / fabs((-1.0 / (((((eh / ew) * tan(t)) * t_1) + t_2) / sqrt((1.0 + pow(((tan(t) / ew) * eh), 2.0))))));
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sin(t) * eh
t_2 = cos(t) * ew
t_3 = abs(((sin(atan(((-eh * t) / ew))) * t_1) - (cos(atan((-t * (eh / ew)))) * t_2)))
if (eh <= (-60000.0d0)) then
tmp = t_3
else if (eh <= 1.04d-22) then
tmp = 1.0d0 / abs(((-1.0d0) / (((((eh / ew) * tan(t)) * t_1) + t_2) / sqrt((1.0d0 + (((tan(t) / ew) * eh) ** 2.0d0))))))
else
tmp = t_3
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(t) * eh;
double t_2 = Math.cos(t) * ew;
double t_3 = Math.abs(((Math.sin(Math.atan(((-eh * t) / ew))) * t_1) - (Math.cos(Math.atan((-t * (eh / ew)))) * t_2)));
double tmp;
if (eh <= -60000.0) {
tmp = t_3;
} else if (eh <= 1.04e-22) {
tmp = 1.0 / Math.abs((-1.0 / (((((eh / ew) * Math.tan(t)) * t_1) + t_2) / Math.sqrt((1.0 + Math.pow(((Math.tan(t) / ew) * eh), 2.0))))));
} else {
tmp = t_3;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * eh t_2 = math.cos(t) * ew t_3 = math.fabs(((math.sin(math.atan(((-eh * t) / ew))) * t_1) - (math.cos(math.atan((-t * (eh / ew)))) * t_2))) tmp = 0 if eh <= -60000.0: tmp = t_3 elif eh <= 1.04e-22: tmp = 1.0 / math.fabs((-1.0 / (((((eh / ew) * math.tan(t)) * t_1) + t_2) / math.sqrt((1.0 + math.pow(((math.tan(t) / ew) * eh), 2.0)))))) else: tmp = t_3 return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) t_2 = Float64(cos(t) * ew) t_3 = abs(Float64(Float64(sin(atan(Float64(Float64(Float64(-eh) * t) / ew))) * t_1) - Float64(cos(atan(Float64(Float64(-t) * Float64(eh / ew)))) * t_2))) tmp = 0.0 if (eh <= -60000.0) tmp = t_3; elseif (eh <= 1.04e-22) tmp = Float64(1.0 / abs(Float64(-1.0 / Float64(Float64(Float64(Float64(Float64(eh / ew) * tan(t)) * t_1) + t_2) / sqrt(Float64(1.0 + (Float64(Float64(tan(t) / ew) * eh) ^ 2.0))))))); else tmp = t_3; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * eh; t_2 = cos(t) * ew; t_3 = abs(((sin(atan(((-eh * t) / ew))) * t_1) - (cos(atan((-t * (eh / ew)))) * t_2))); tmp = 0.0; if (eh <= -60000.0) tmp = t_3; elseif (eh <= 1.04e-22) tmp = 1.0 / abs((-1.0 / (((((eh / ew) * tan(t)) * t_1) + t_2) / sqrt((1.0 + (((tan(t) / ew) * eh) ^ 2.0)))))); else tmp = t_3; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(N[(N[Sin[N[ArcTan[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] - N[(N[Cos[N[ArcTan[N[((-t) * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -60000.0], t$95$3, If[LessEqual[eh, 1.04e-22], N[(1.0 / N[Abs[N[(-1.0 / N[(N[(N[(N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := \cos t \cdot ew\\
t_3 := \left|\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right) \cdot t\_1 - \cos \tan^{-1} \left(\left(-t\right) \cdot \frac{eh}{ew}\right) \cdot t\_2\right|\\
\mathbf{if}\;eh \leq -60000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;eh \leq 1.04 \cdot 10^{-22}:\\
\;\;\;\;\frac{1}{\left|\frac{-1}{\frac{\left(\frac{eh}{ew} \cdot \tan t\right) \cdot t\_1 + t\_2}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}}\right|}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if eh < -6e4 or 1.04e-22 < eh Initial program 99.8%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.3
Applied rewrites99.3%
Taylor expanded in t around 0
associate-*l/N/A
associate-*l*N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6492.3
Applied rewrites92.3%
if -6e4 < eh < 1.04e-22Initial program 99.8%
Applied rewrites99.6%
Applied rewrites98.8%
Final simplification95.5%
(FPCore (eh ew t)
:precision binary64
(if (<= eh -6.2e+50)
(fabs (* (* (- (sin t)) eh) (sin (atan (* (- t) (/ eh ew))))))
(if (<= eh 6.5e+42)
(/
1.0
(fabs
(/
-1.0
(/
(+ (* (* (/ eh ew) (tan t)) (* (sin t) eh)) (* (cos t) ew))
(sqrt (+ 1.0 (pow (* (/ (tan t) ew) eh) 2.0)))))))
(fabs (* (* (sin (atan (/ (* eh t) ew))) eh) (sin t))))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= -6.2e+50) {
tmp = fabs(((-sin(t) * eh) * sin(atan((-t * (eh / ew))))));
} else if (eh <= 6.5e+42) {
tmp = 1.0 / fabs((-1.0 / (((((eh / ew) * tan(t)) * (sin(t) * eh)) + (cos(t) * ew)) / sqrt((1.0 + pow(((tan(t) / ew) * eh), 2.0))))));
} else {
tmp = fabs(((sin(atan(((eh * t) / ew))) * eh) * sin(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (eh <= (-6.2d+50)) then
tmp = abs(((-sin(t) * eh) * sin(atan((-t * (eh / ew))))))
else if (eh <= 6.5d+42) then
tmp = 1.0d0 / abs(((-1.0d0) / (((((eh / ew) * tan(t)) * (sin(t) * eh)) + (cos(t) * ew)) / sqrt((1.0d0 + (((tan(t) / ew) * eh) ** 2.0d0))))))
else
tmp = abs(((sin(atan(((eh * t) / ew))) * eh) * sin(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (eh <= -6.2e+50) {
tmp = Math.abs(((-Math.sin(t) * eh) * Math.sin(Math.atan((-t * (eh / ew))))));
} else if (eh <= 6.5e+42) {
tmp = 1.0 / Math.abs((-1.0 / (((((eh / ew) * Math.tan(t)) * (Math.sin(t) * eh)) + (Math.cos(t) * ew)) / Math.sqrt((1.0 + Math.pow(((Math.tan(t) / ew) * eh), 2.0))))));
} else {
tmp = Math.abs(((Math.sin(Math.atan(((eh * t) / ew))) * eh) * Math.sin(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if eh <= -6.2e+50: tmp = math.fabs(((-math.sin(t) * eh) * math.sin(math.atan((-t * (eh / ew)))))) elif eh <= 6.5e+42: tmp = 1.0 / math.fabs((-1.0 / (((((eh / ew) * math.tan(t)) * (math.sin(t) * eh)) + (math.cos(t) * ew)) / math.sqrt((1.0 + math.pow(((math.tan(t) / ew) * eh), 2.0)))))) else: tmp = math.fabs(((math.sin(math.atan(((eh * t) / ew))) * eh) * math.sin(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if (eh <= -6.2e+50) tmp = abs(Float64(Float64(Float64(-sin(t)) * eh) * sin(atan(Float64(Float64(-t) * Float64(eh / ew)))))); elseif (eh <= 6.5e+42) tmp = Float64(1.0 / abs(Float64(-1.0 / Float64(Float64(Float64(Float64(Float64(eh / ew) * tan(t)) * Float64(sin(t) * eh)) + Float64(cos(t) * ew)) / sqrt(Float64(1.0 + (Float64(Float64(tan(t) / ew) * eh) ^ 2.0))))))); else tmp = abs(Float64(Float64(sin(atan(Float64(Float64(eh * t) / ew))) * eh) * sin(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (eh <= -6.2e+50) tmp = abs(((-sin(t) * eh) * sin(atan((-t * (eh / ew)))))); elseif (eh <= 6.5e+42) tmp = 1.0 / abs((-1.0 / (((((eh / ew) * tan(t)) * (sin(t) * eh)) + (cos(t) * ew)) / sqrt((1.0 + (((tan(t) / ew) * eh) ^ 2.0)))))); else tmp = abs(((sin(atan(((eh * t) / ew))) * eh) * sin(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[eh, -6.2e+50], N[Abs[N[(N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[((-t) * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 6.5e+42], N[(1.0 / N[Abs[N[(-1.0 / N[(N[(N[(N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[(N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -6.2 \cdot 10^{+50}:\\
\;\;\;\;\left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\left(-t\right) \cdot \frac{eh}{ew}\right)\right|\\
\mathbf{elif}\;eh \leq 6.5 \cdot 10^{+42}:\\
\;\;\;\;\frac{1}{\left|\frac{-1}{\frac{\left(\frac{eh}{ew} \cdot \tan t\right) \cdot \left(\sin t \cdot eh\right) + \cos t \cdot ew}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}}}\right|}\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot eh\right) \cdot \sin t\right|\\
\end{array}
\end{array}
if eh < -6.20000000000000006e50Initial program 99.8%
Taylor expanded in ew around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites68.9%
Taylor expanded in t around 0
Applied rewrites69.1%
if -6.20000000000000006e50 < eh < 6.50000000000000052e42Initial program 99.8%
Applied rewrites99.6%
Applied rewrites97.5%
if 6.50000000000000052e42 < eh Initial program 99.8%
Taylor expanded in ew around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites68.7%
Applied rewrites68.7%
Taylor expanded in t around 0
Applied rewrites69.0%
Final simplification85.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (- (sin t))))
(if (<= eh -1.55e+58)
(fabs (* (* t_1 eh) (sin (atan (* (- t) (/ eh ew))))))
(if (<= eh 1.65e+36)
(fabs (* (cos (atan (* (/ eh (cos t)) (/ t_1 ew)))) (* (cos t) ew)))
(fabs (* (* (sin (atan (/ (* eh t) ew))) eh) (sin t)))))))
double code(double eh, double ew, double t) {
double t_1 = -sin(t);
double tmp;
if (eh <= -1.55e+58) {
tmp = fabs(((t_1 * eh) * sin(atan((-t * (eh / ew))))));
} else if (eh <= 1.65e+36) {
tmp = fabs((cos(atan(((eh / cos(t)) * (t_1 / ew)))) * (cos(t) * ew)));
} else {
tmp = fabs(((sin(atan(((eh * t) / ew))) * eh) * sin(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = -sin(t)
if (eh <= (-1.55d+58)) then
tmp = abs(((t_1 * eh) * sin(atan((-t * (eh / ew))))))
else if (eh <= 1.65d+36) then
tmp = abs((cos(atan(((eh / cos(t)) * (t_1 / ew)))) * (cos(t) * ew)))
else
tmp = abs(((sin(atan(((eh * t) / ew))) * eh) * sin(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = -Math.sin(t);
double tmp;
if (eh <= -1.55e+58) {
tmp = Math.abs(((t_1 * eh) * Math.sin(Math.atan((-t * (eh / ew))))));
} else if (eh <= 1.65e+36) {
tmp = Math.abs((Math.cos(Math.atan(((eh / Math.cos(t)) * (t_1 / ew)))) * (Math.cos(t) * ew)));
} else {
tmp = Math.abs(((Math.sin(Math.atan(((eh * t) / ew))) * eh) * Math.sin(t)));
}
return tmp;
}
def code(eh, ew, t): t_1 = -math.sin(t) tmp = 0 if eh <= -1.55e+58: tmp = math.fabs(((t_1 * eh) * math.sin(math.atan((-t * (eh / ew)))))) elif eh <= 1.65e+36: tmp = math.fabs((math.cos(math.atan(((eh / math.cos(t)) * (t_1 / ew)))) * (math.cos(t) * ew))) else: tmp = math.fabs(((math.sin(math.atan(((eh * t) / ew))) * eh) * math.sin(t))) return tmp
function code(eh, ew, t) t_1 = Float64(-sin(t)) tmp = 0.0 if (eh <= -1.55e+58) tmp = abs(Float64(Float64(t_1 * eh) * sin(atan(Float64(Float64(-t) * Float64(eh / ew)))))); elseif (eh <= 1.65e+36) tmp = abs(Float64(cos(atan(Float64(Float64(eh / cos(t)) * Float64(t_1 / ew)))) * Float64(cos(t) * ew))); else tmp = abs(Float64(Float64(sin(atan(Float64(Float64(eh * t) / ew))) * eh) * sin(t))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = -sin(t); tmp = 0.0; if (eh <= -1.55e+58) tmp = abs(((t_1 * eh) * sin(atan((-t * (eh / ew)))))); elseif (eh <= 1.65e+36) tmp = abs((cos(atan(((eh / cos(t)) * (t_1 / ew)))) * (cos(t) * ew))); else tmp = abs(((sin(atan(((eh * t) / ew))) * eh) * sin(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = (-N[Sin[t], $MachinePrecision])}, If[LessEqual[eh, -1.55e+58], N[Abs[N[(N[(t$95$1 * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[((-t) * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 1.65e+36], N[Abs[N[(N[Cos[N[ArcTan[N[(N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\sin t\\
\mathbf{if}\;eh \leq -1.55 \cdot 10^{+58}:\\
\;\;\;\;\left|\left(t\_1 \cdot eh\right) \cdot \sin \tan^{-1} \left(\left(-t\right) \cdot \frac{eh}{ew}\right)\right|\\
\mathbf{elif}\;eh \leq 1.65 \cdot 10^{+36}:\\
\;\;\;\;\left|\cos \tan^{-1} \left(\frac{eh}{\cos t} \cdot \frac{t\_1}{ew}\right) \cdot \left(\cos t \cdot ew\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot eh\right) \cdot \sin t\right|\\
\end{array}
\end{array}
if eh < -1.55e58Initial program 99.8%
Taylor expanded in ew around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites69.6%
Taylor expanded in t around 0
Applied rewrites69.7%
if -1.55e58 < eh < 1.6499999999999999e36Initial program 99.8%
Taylor expanded in ew around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites85.1%
if 1.6499999999999999e36 < eh Initial program 99.8%
Taylor expanded in ew around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites68.7%
Applied rewrites68.7%
Taylor expanded in t around 0
Applied rewrites69.0%
Final simplification78.3%
(FPCore (eh ew t)
:precision binary64
(if (<= eh -1.55e+58)
(fabs (* (* (- (sin t)) eh) (sin (atan (* (- t) (/ eh ew))))))
(if (<= eh 1.65e+36)
(fabs (/ (* (- ew) (cos t)) (/ 1.0 (cos (atan (* (/ (tan t) ew) eh))))))
(fabs (* (* (sin (atan (/ (* eh t) ew))) eh) (sin t))))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= -1.55e+58) {
tmp = fabs(((-sin(t) * eh) * sin(atan((-t * (eh / ew))))));
} else if (eh <= 1.65e+36) {
tmp = fabs(((-ew * cos(t)) / (1.0 / cos(atan(((tan(t) / ew) * eh))))));
} else {
tmp = fabs(((sin(atan(((eh * t) / ew))) * eh) * sin(t)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (eh <= (-1.55d+58)) then
tmp = abs(((-sin(t) * eh) * sin(atan((-t * (eh / ew))))))
else if (eh <= 1.65d+36) then
tmp = abs(((-ew * cos(t)) / (1.0d0 / cos(atan(((tan(t) / ew) * eh))))))
else
tmp = abs(((sin(atan(((eh * t) / ew))) * eh) * sin(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (eh <= -1.55e+58) {
tmp = Math.abs(((-Math.sin(t) * eh) * Math.sin(Math.atan((-t * (eh / ew))))));
} else if (eh <= 1.65e+36) {
tmp = Math.abs(((-ew * Math.cos(t)) / (1.0 / Math.cos(Math.atan(((Math.tan(t) / ew) * eh))))));
} else {
tmp = Math.abs(((Math.sin(Math.atan(((eh * t) / ew))) * eh) * Math.sin(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if eh <= -1.55e+58: tmp = math.fabs(((-math.sin(t) * eh) * math.sin(math.atan((-t * (eh / ew)))))) elif eh <= 1.65e+36: tmp = math.fabs(((-ew * math.cos(t)) / (1.0 / math.cos(math.atan(((math.tan(t) / ew) * eh)))))) else: tmp = math.fabs(((math.sin(math.atan(((eh * t) / ew))) * eh) * math.sin(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if (eh <= -1.55e+58) tmp = abs(Float64(Float64(Float64(-sin(t)) * eh) * sin(atan(Float64(Float64(-t) * Float64(eh / ew)))))); elseif (eh <= 1.65e+36) tmp = abs(Float64(Float64(Float64(-ew) * cos(t)) / Float64(1.0 / cos(atan(Float64(Float64(tan(t) / ew) * eh)))))); else tmp = abs(Float64(Float64(sin(atan(Float64(Float64(eh * t) / ew))) * eh) * sin(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (eh <= -1.55e+58) tmp = abs(((-sin(t) * eh) * sin(atan((-t * (eh / ew)))))); elseif (eh <= 1.65e+36) tmp = abs(((-ew * cos(t)) / (1.0 / cos(atan(((tan(t) / ew) * eh)))))); else tmp = abs(((sin(atan(((eh * t) / ew))) * eh) * sin(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[eh, -1.55e+58], N[Abs[N[(N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[((-t) * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 1.65e+36], N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.55 \cdot 10^{+58}:\\
\;\;\;\;\left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\left(-t\right) \cdot \frac{eh}{ew}\right)\right|\\
\mathbf{elif}\;eh \leq 1.65 \cdot 10^{+36}:\\
\;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{1}{\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot eh\right) \cdot \sin t\right|\\
\end{array}
\end{array}
if eh < -1.55e58Initial program 99.8%
Taylor expanded in ew around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites69.6%
Taylor expanded in t around 0
Applied rewrites69.7%
if -1.55e58 < eh < 1.6499999999999999e36Initial program 99.8%
Applied rewrites86.4%
Taylor expanded in ew around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f6485.1
Applied rewrites85.1%
if 1.6499999999999999e36 < eh Initial program 99.8%
Taylor expanded in ew around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites68.7%
Applied rewrites68.7%
Taylor expanded in t around 0
Applied rewrites69.0%
Final simplification78.3%
(FPCore (eh ew t)
:precision binary64
(if (<= ew -8e-23)
(fabs (/ ew 1.0))
(if (<= ew 1.36e-30)
(fabs (* (* (- (sin t)) eh) (sin (atan (* (- t) (/ eh ew))))))
(* (cos t) ew))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -8e-23) {
tmp = fabs((ew / 1.0));
} else if (ew <= 1.36e-30) {
tmp = fabs(((-sin(t) * eh) * sin(atan((-t * (eh / ew))))));
} else {
tmp = cos(t) * ew;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (ew <= (-8d-23)) then
tmp = abs((ew / 1.0d0))
else if (ew <= 1.36d-30) then
tmp = abs(((-sin(t) * eh) * sin(atan((-t * (eh / ew))))))
else
tmp = cos(t) * ew
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -8e-23) {
tmp = Math.abs((ew / 1.0));
} else if (ew <= 1.36e-30) {
tmp = Math.abs(((-Math.sin(t) * eh) * Math.sin(Math.atan((-t * (eh / ew))))));
} else {
tmp = Math.cos(t) * ew;
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -8e-23: tmp = math.fabs((ew / 1.0)) elif ew <= 1.36e-30: tmp = math.fabs(((-math.sin(t) * eh) * math.sin(math.atan((-t * (eh / ew)))))) else: tmp = math.cos(t) * ew return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -8e-23) tmp = abs(Float64(ew / 1.0)); elseif (ew <= 1.36e-30) tmp = abs(Float64(Float64(Float64(-sin(t)) * eh) * sin(atan(Float64(Float64(-t) * Float64(eh / ew)))))); else tmp = Float64(cos(t) * ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -8e-23) tmp = abs((ew / 1.0)); elseif (ew <= 1.36e-30) tmp = abs(((-sin(t) * eh) * sin(atan((-t * (eh / ew)))))); else tmp = cos(t) * ew; end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -8e-23], N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.36e-30], N[Abs[N[(N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[((-t) * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -8 \cdot 10^{-23}:\\
\;\;\;\;\left|\frac{ew}{1}\right|\\
\mathbf{elif}\;ew \leq 1.36 \cdot 10^{-30}:\\
\;\;\;\;\left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\left(-t\right) \cdot \frac{eh}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\
\end{array}
\end{array}
if ew < -7.99999999999999968e-23Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.5%
Taylor expanded in t around 0
Applied rewrites49.2%
Applied rewrites48.2%
Taylor expanded in ew around inf
Applied rewrites51.6%
if -7.99999999999999968e-23 < ew < 1.36e-30Initial program 99.7%
Taylor expanded in ew around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites67.7%
Taylor expanded in t around 0
Applied rewrites67.8%
if 1.36e-30 < ew Initial program 99.8%
Applied rewrites99.6%
Applied rewrites79.8%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
Final simplification65.5%
(FPCore (eh ew t)
:precision binary64
(if (<= ew -8e-23)
(fabs (/ ew 1.0))
(if (<= ew 1.36e-30)
(fabs (* (* (sin (atan (/ (* eh t) ew))) eh) (sin t)))
(* (cos t) ew))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -8e-23) {
tmp = fabs((ew / 1.0));
} else if (ew <= 1.36e-30) {
tmp = fabs(((sin(atan(((eh * t) / ew))) * eh) * sin(t)));
} else {
tmp = cos(t) * ew;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (ew <= (-8d-23)) then
tmp = abs((ew / 1.0d0))
else if (ew <= 1.36d-30) then
tmp = abs(((sin(atan(((eh * t) / ew))) * eh) * sin(t)))
else
tmp = cos(t) * ew
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -8e-23) {
tmp = Math.abs((ew / 1.0));
} else if (ew <= 1.36e-30) {
tmp = Math.abs(((Math.sin(Math.atan(((eh * t) / ew))) * eh) * Math.sin(t)));
} else {
tmp = Math.cos(t) * ew;
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -8e-23: tmp = math.fabs((ew / 1.0)) elif ew <= 1.36e-30: tmp = math.fabs(((math.sin(math.atan(((eh * t) / ew))) * eh) * math.sin(t))) else: tmp = math.cos(t) * ew return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -8e-23) tmp = abs(Float64(ew / 1.0)); elseif (ew <= 1.36e-30) tmp = abs(Float64(Float64(sin(atan(Float64(Float64(eh * t) / ew))) * eh) * sin(t))); else tmp = Float64(cos(t) * ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -8e-23) tmp = abs((ew / 1.0)); elseif (ew <= 1.36e-30) tmp = abs(((sin(atan(((eh * t) / ew))) * eh) * sin(t))); else tmp = cos(t) * ew; end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -8e-23], N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.36e-30], N[Abs[N[(N[(N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -8 \cdot 10^{-23}:\\
\;\;\;\;\left|\frac{ew}{1}\right|\\
\mathbf{elif}\;ew \leq 1.36 \cdot 10^{-30}:\\
\;\;\;\;\left|\left(\sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot eh\right) \cdot \sin t\right|\\
\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\
\end{array}
\end{array}
if ew < -7.99999999999999968e-23Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.5%
Taylor expanded in t around 0
Applied rewrites49.2%
Applied rewrites48.2%
Taylor expanded in ew around inf
Applied rewrites51.6%
if -7.99999999999999968e-23 < ew < 1.36e-30Initial program 99.7%
Taylor expanded in ew around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites67.7%
Applied rewrites67.7%
Taylor expanded in t around 0
Applied rewrites67.8%
if 1.36e-30 < ew Initial program 99.8%
Applied rewrites99.6%
Applied rewrites79.8%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
Final simplification65.5%
(FPCore (eh ew t) :precision binary64 (fabs (/ ew 1.0)))
double code(double eh, double ew, double t) {
return fabs((ew / 1.0));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew / 1.0d0))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew / 1.0));
}
def code(eh, ew, t): return math.fabs((ew / 1.0))
function code(eh, ew, t) return abs(Float64(ew / 1.0)) end
function tmp = code(eh, ew, t) tmp = abs((ew / 1.0)); end
code[eh_, ew_, t_] := N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew}{1}\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites41.7%
Taylor expanded in t around 0
Applied rewrites39.9%
Applied rewrites38.9%
Taylor expanded in ew around inf
Applied rewrites41.9%
herbie shell --seed 2024249
(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)))))))