
(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 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))));
}
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 (fabs (- (* ew (* (cos t) (cos (atan (* (/ (tan t) ew) eh))))) (* eh (* (sin t) (sin (atan (/ (- eh) (/ ew (tan t))))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * (cos(t) * cos(atan(((tan(t) / ew) * eh))))) - (eh * (sin(t) * sin(atan((-eh / (ew / tan(t)))))))));
}
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 * (cos(t) * cos(atan(((tan(t) / ew) * eh))))) - (eh * (sin(t) * sin(atan((-eh / (ew / tan(t)))))))))
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) / ew) * eh))))) - (eh * (Math.sin(t) * Math.sin(Math.atan((-eh / (ew / Math.tan(t)))))))));
}
def code(eh, ew, t): return math.fabs(((ew * (math.cos(t) * math.cos(math.atan(((math.tan(t) / ew) * eh))))) - (eh * (math.sin(t) * math.sin(math.atan((-eh / (ew / math.tan(t)))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * Float64(cos(t) * cos(atan(Float64(Float64(tan(t) / ew) * eh))))) - Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(-eh) / Float64(ew / tan(t))))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * (cos(t) * cos(atan(((tan(t) / ew) * eh))))) - (eh * (sin(t) * sin(atan((-eh / (ew / tan(t))))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[((-eh) / N[(ew / N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
clear-num99.7%
associate-/r/99.7%
clear-num99.7%
add-sqr-sqrt47.9%
sqrt-unprod93.4%
sqr-neg93.4%
sqrt-unprod51.8%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (* (cos t) (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew)))))) (* eh (* (sin t) (sin (atan (/ (- eh) (/ ew (tan t))))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))) - (eh * (sin(t) * sin(atan((-eh / (ew / tan(t)))))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * (Math.cos(t) * (1.0 / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))))) - (eh * (Math.sin(t) * Math.sin(Math.atan((-eh / (ew / Math.tan(t)))))))));
}
def code(eh, ew, t): return math.fabs(((ew * (math.cos(t) * (1.0 / math.hypot(1.0, (math.tan(t) * (eh / ew)))))) - (eh * (math.sin(t) * math.sin(math.atan((-eh / (ew / math.tan(t)))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * Float64(cos(t) * Float64(1.0 / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))))) - Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(-eh) / Float64(ew / tan(t))))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))) - (eh * (sin(t) * sin(atan((-eh / (ew / tan(t))))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[((-eh) / N[(ew / N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{\tan t}}\right)\right)\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
cos-atan64.4%
hypot-1-def64.4%
div-inv64.4%
add-sqr-sqrt30.8%
sqrt-unprod57.6%
sqr-neg57.6%
sqrt-unprod33.6%
add-sqr-sqrt64.4%
clear-num64.4%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.7%
associate-*r/99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (* (cos t) (/ 1.0 (hypot 1.0 (* (tan t) (/ eh ew)))))) (* (sin t) (* eh (sin (atan (* (- eh) (/ t ew)))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))) - (sin(t) * (eh * sin(atan((-eh * (t / ew))))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * (Math.cos(t) * (1.0 / Math.hypot(1.0, (Math.tan(t) * (eh / ew)))))) - (Math.sin(t) * (eh * Math.sin(Math.atan((-eh * (t / ew))))))));
}
def code(eh, ew, t): return math.fabs(((ew * (math.cos(t) * (1.0 / math.hypot(1.0, (math.tan(t) * (eh / ew)))))) - (math.sin(t) * (eh * math.sin(math.atan((-eh * (t / ew))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * Float64(cos(t) * Float64(1.0 / hypot(1.0, Float64(tan(t) * Float64(eh / ew)))))) - Float64(sin(t) * Float64(eh * sin(atan(Float64(Float64(-eh) * Float64(t / ew)))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * (cos(t) * (1.0 / hypot(1.0, (tan(t) * (eh / ew)))))) - (sin(t) * (eh * sin(atan((-eh * (t / ew)))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[N[((-eh) * N[(t / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{t}{ew}\right)\right)\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
Taylor expanded in eh around 0 99.7%
*-commutative99.7%
mul-1-neg99.7%
associate-*l/99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
Simplified99.7%
cos-atan64.4%
hypot-1-def64.4%
div-inv64.4%
add-sqr-sqrt30.8%
sqrt-unprod57.6%
sqr-neg57.6%
sqrt-unprod33.6%
add-sqr-sqrt64.4%
clear-num64.4%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in t around 0 98.9%
Final simplification98.9%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (sin t) (* eh (sin (atan (* (/ (tan t) ew) (- eh)))))) (* ew (cos t)))))
double code(double eh, double ew, double t) {
return fabs(((sin(t) * (eh * sin(atan(((tan(t) / ew) * -eh))))) - (ew * cos(t))));
}
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(t) * (eh * sin(atan(((tan(t) / ew) * -eh))))) - (ew * cos(t))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((Math.sin(t) * (eh * Math.sin(Math.atan(((Math.tan(t) / ew) * -eh))))) - (ew * Math.cos(t))));
}
def code(eh, ew, t): return math.fabs(((math.sin(t) * (eh * math.sin(math.atan(((math.tan(t) / ew) * -eh))))) - (ew * math.cos(t))))
function code(eh, ew, t) return abs(Float64(Float64(sin(t) * Float64(eh * sin(atan(Float64(Float64(tan(t) / ew) * Float64(-eh)))))) - Float64(ew * cos(t)))) end
function tmp = code(eh, ew, t) tmp = abs(((sin(t) * (eh * sin(atan(((tan(t) / ew) * -eh))))) - (ew * cos(t)))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right)\right) - ew \cdot \cos t\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
Taylor expanded in eh around 0 99.7%
*-commutative99.7%
mul-1-neg99.7%
associate-*l/99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
Simplified99.7%
cos-atan64.4%
hypot-1-def64.4%
div-inv64.4%
add-sqr-sqrt30.8%
sqrt-unprod57.6%
sqr-neg57.6%
sqrt-unprod33.6%
add-sqr-sqrt64.4%
clear-num64.4%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in t around 0 97.9%
Final simplification97.9%
(FPCore (eh ew t) :precision binary64 (fabs (- (* ew (* (cos t) (cos (atan (/ (- t) (/ ew eh)))))) (* eh (sin t)))))
double code(double eh, double ew, double t) {
return fabs(((ew * (cos(t) * cos(atan((-t / (ew / eh)))))) - (eh * sin(t))));
}
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 * (cos(t) * cos(atan((-t / (ew / eh)))))) - (eh * sin(t))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * (Math.cos(t) * Math.cos(Math.atan((-t / (ew / eh)))))) - (eh * Math.sin(t))));
}
def code(eh, ew, t): return math.fabs(((ew * (math.cos(t) * math.cos(math.atan((-t / (ew / eh)))))) - (eh * math.sin(t))))
function code(eh, ew, t) return abs(Float64(Float64(ew * Float64(cos(t) * cos(atan(Float64(Float64(-t) / Float64(ew / eh)))))) - Float64(eh * sin(t)))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * (cos(t) * cos(atan((-t / (ew / eh)))))) - (eh * sin(t)))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[((-t) / N[(ew / eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{-t}{\frac{ew}{eh}}\right)\right) - eh \cdot \sin t\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
Taylor expanded in t around 0 88.8%
mul-1-neg88.8%
associate-/l*88.8%
distribute-neg-frac88.8%
Simplified88.8%
associate-*r*88.8%
sin-atan72.7%
associate-*r/70.1%
div-inv70.0%
add-sqr-sqrt34.1%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod35.9%
add-sqr-sqrt69.6%
clear-num69.5%
hypot-1-def73.5%
div-inv73.6%
Applied egg-rr73.6%
associate-/l*80.5%
associate-/r/80.5%
*-commutative80.5%
associate-*l/80.4%
associate-*r/77.1%
*-commutative77.1%
associate-*l/77.1%
associate-*r/77.0%
Simplified77.0%
Taylor expanded in eh around inf 88.2%
Final simplification88.2%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (* (cos t) (cos (atan (/ (- t) (/ ew eh)))))) (* eh (sin t)))))
double code(double eh, double ew, double t) {
return fabs(((ew * (cos(t) * cos(atan((-t / (ew / eh)))))) + (eh * sin(t))));
}
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 * (cos(t) * cos(atan((-t / (ew / eh)))))) + (eh * sin(t))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * (Math.cos(t) * Math.cos(Math.atan((-t / (ew / eh)))))) + (eh * Math.sin(t))));
}
def code(eh, ew, t): return math.fabs(((ew * (math.cos(t) * math.cos(math.atan((-t / (ew / eh)))))) + (eh * math.sin(t))))
function code(eh, ew, t) return abs(Float64(Float64(ew * Float64(cos(t) * cos(atan(Float64(Float64(-t) / Float64(ew / eh)))))) + Float64(eh * sin(t)))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * (cos(t) * cos(atan((-t / (ew / eh)))))) + (eh * sin(t)))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[((-t) / N[(ew / eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{-t}{\frac{ew}{eh}}\right)\right) + eh \cdot \sin t\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
Taylor expanded in t around 0 88.8%
mul-1-neg88.8%
associate-/l*88.8%
distribute-neg-frac88.8%
Simplified88.8%
associate-*r*88.8%
sin-atan72.7%
associate-*r/70.1%
div-inv70.0%
add-sqr-sqrt34.1%
sqrt-unprod59.9%
sqr-neg59.9%
sqrt-unprod35.9%
add-sqr-sqrt69.6%
clear-num69.5%
hypot-1-def73.5%
div-inv73.6%
Applied egg-rr73.6%
associate-/l*80.5%
associate-/r/80.5%
*-commutative80.5%
associate-*l/80.4%
associate-*r/77.1%
*-commutative77.1%
associate-*l/77.1%
associate-*r/77.0%
Simplified77.0%
Taylor expanded in eh around -inf 88.2%
mul-1-neg88.2%
*-commutative88.2%
distribute-lft-neg-in88.2%
Simplified88.2%
Final simplification88.2%
(FPCore (eh ew t)
:precision binary64
(fabs
(*
ew
(*
(cos t)
(cos (atan (/ (- eh) (+ (* -0.3333333333333333 (* ew t)) (/ ew t)))))))))
double code(double eh, double ew, double t) {
return fabs((ew * (cos(t) * cos(atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))))))));
}
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 * (cos(t) * cos(atan((-eh / (((-0.3333333333333333d0) * (ew * t)) + (ew / t))))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (Math.cos(t) * Math.cos(Math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))))))));
}
def code(eh, ew, t): return math.fabs((ew * (math.cos(t) * math.cos(math.atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t))))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(cos(t) * cos(atan(Float64(Float64(-eh) / Float64(Float64(-0.3333333333333333 * Float64(ew * t)) + Float64(ew / t)))))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (cos(t) * cos(atan((-eh / ((-0.3333333333333333 * (ew * t)) + (ew / t)))))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[((-eh) / N[(N[(-0.3333333333333333 * N[(ew * t), $MachinePrecision]), $MachinePrecision] + N[(ew / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{-eh}{-0.3333333333333333 \cdot \left(ew \cdot t\right) + \frac{ew}{t}}\right)\right)\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
sin-mult66.1%
associate-*r/66.1%
Applied egg-rr64.6%
+-inverses64.6%
*-commutative64.6%
associate-/l*64.6%
div064.6%
Simplified64.6%
Taylor expanded in t around 0 64.7%
Final simplification64.7%
(FPCore (eh ew t)
:precision binary64
(if (or (<= eh -2.7e-32) (not (<= eh 4.5e+55)))
(* (fabs ew) (fabs (/ 1.0 (hypot 1.0 (* (/ (tan t) ew) eh)))))
(fabs
(+
(/ (* t t) (/ ew (* eh eh)))
(* ew (* (cos t) (/ -1.0 (hypot 1.0 (/ (- t) (/ ew eh))))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -2.7e-32) || !(eh <= 4.5e+55)) {
tmp = fabs(ew) * fabs((1.0 / hypot(1.0, ((tan(t) / ew) * eh))));
} else {
tmp = fabs((((t * t) / (ew / (eh * eh))) + (ew * (cos(t) * (-1.0 / hypot(1.0, (-t / (ew / eh))))))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -2.7e-32) || !(eh <= 4.5e+55)) {
tmp = Math.abs(ew) * Math.abs((1.0 / Math.hypot(1.0, ((Math.tan(t) / ew) * eh))));
} else {
tmp = Math.abs((((t * t) / (ew / (eh * eh))) + (ew * (Math.cos(t) * (-1.0 / Math.hypot(1.0, (-t / (ew / eh))))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -2.7e-32) or not (eh <= 4.5e+55): tmp = math.fabs(ew) * math.fabs((1.0 / math.hypot(1.0, ((math.tan(t) / ew) * eh)))) else: tmp = math.fabs((((t * t) / (ew / (eh * eh))) + (ew * (math.cos(t) * (-1.0 / math.hypot(1.0, (-t / (ew / eh)))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -2.7e-32) || !(eh <= 4.5e+55)) tmp = Float64(abs(ew) * abs(Float64(1.0 / hypot(1.0, Float64(Float64(tan(t) / ew) * eh))))); else tmp = abs(Float64(Float64(Float64(t * t) / Float64(ew / Float64(eh * eh))) + Float64(ew * Float64(cos(t) * Float64(-1.0 / hypot(1.0, Float64(Float64(-t) / Float64(ew / eh)))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -2.7e-32) || ~((eh <= 4.5e+55))) tmp = abs(ew) * abs((1.0 / hypot(1.0, ((tan(t) / ew) * eh)))); else tmp = abs((((t * t) / (ew / (eh * eh))) + (ew * (cos(t) * (-1.0 / hypot(1.0, (-t / (ew / eh)))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -2.7e-32], N[Not[LessEqual[eh, 4.5e+55]], $MachinePrecision]], N[(N[Abs[ew], $MachinePrecision] * N[Abs[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[(N[(t * t), $MachinePrecision] / N[(ew / N[(eh * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(-1.0 / N[Sqrt[1.0 ^ 2 + N[((-t) / N[(ew / eh), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -2.7 \cdot 10^{-32} \lor \neg \left(eh \leq 4.5 \cdot 10^{+55}\right):\\
\;\;\;\;\left|ew\right| \cdot \left|\frac{1}{\mathsf{hypot}\left(1, \frac{\tan t}{ew} \cdot eh\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{t \cdot t}{\frac{ew}{eh \cdot eh}} + ew \cdot \left(\cos t \cdot \frac{-1}{\mathsf{hypot}\left(1, \frac{-t}{\frac{ew}{eh}}\right)}\right)\right|\\
\end{array}
\end{array}
if eh < -2.69999999999999981e-32 or 4.49999999999999998e55 < eh Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
sin-mult45.4%
associate-*r/45.4%
Applied egg-rr42.3%
+-inverses42.3%
*-commutative42.3%
associate-/l*42.3%
div042.3%
Simplified42.3%
Taylor expanded in t around 0 32.1%
*-commutative32.1%
*-commutative32.1%
associate-*r/32.1%
associate-*l*32.1%
neg-mul-132.1%
*-commutative32.1%
associate-*l/32.1%
distribute-rgt-neg-in32.1%
Simplified32.1%
distribute-frac-neg32.1%
*-commutative32.1%
associate-*r/32.1%
distribute-lft-neg-out32.1%
cos-atan31.5%
hypot-1-def31.6%
add-sqr-sqrt20.9%
sqrt-unprod20.3%
sqr-neg20.3%
sqrt-unprod10.7%
add-sqr-sqrt31.6%
associate-*r/31.6%
*-commutative31.6%
associate-*r/31.6%
frac-2neg31.6%
metadata-eval31.6%
Applied egg-rr31.6%
/-rgt-identity31.6%
/-rgt-identity31.6%
*-commutative31.6%
associate-*l/31.6%
associate-*r/31.6%
Simplified31.6%
if -2.69999999999999981e-32 < eh < 4.49999999999999998e55Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
Taylor expanded in t around 0 88.5%
mul-1-neg88.5%
associate-/l*88.5%
distribute-neg-frac88.5%
Simplified88.5%
associate-*r*88.4%
sin-atan85.6%
associate-*r/85.6%
div-inv85.5%
add-sqr-sqrt38.4%
sqrt-unprod82.8%
sqr-neg82.8%
sqrt-unprod47.2%
add-sqr-sqrt84.9%
clear-num85.0%
hypot-1-def87.8%
div-inv87.8%
Applied egg-rr87.8%
associate-/l*87.8%
associate-/r/87.8%
*-commutative87.8%
associate-*l/87.8%
associate-*r/87.8%
*-commutative87.8%
associate-*l/87.8%
associate-*r/87.8%
Simplified87.8%
Taylor expanded in t around 0 66.3%
associate-/l*66.1%
unpow266.1%
unpow266.1%
Simplified66.1%
cos-atan66.0%
hypot-1-def66.0%
Applied egg-rr66.0%
Final simplification49.9%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (* (cos t) (/ 1.0 (hypot 1.0 (* (/ (tan t) ew) eh)))))))
double code(double eh, double ew, double t) {
return fabs((ew * (cos(t) * (1.0 / hypot(1.0, ((tan(t) / ew) * eh))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (Math.cos(t) * (1.0 / Math.hypot(1.0, ((Math.tan(t) / ew) * eh))))));
}
def code(eh, ew, t): return math.fabs((ew * (math.cos(t) * (1.0 / math.hypot(1.0, ((math.tan(t) / ew) * eh))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(cos(t) * Float64(1.0 / hypot(1.0, Float64(Float64(tan(t) / ew) * eh)))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (cos(t) * (1.0 / hypot(1.0, ((tan(t) / ew) * eh)))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{\tan t}{ew} \cdot eh\right)}\right)\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
sin-mult66.1%
associate-*r/66.1%
Applied egg-rr64.6%
+-inverses64.6%
*-commutative64.6%
associate-/l*64.6%
div064.6%
Simplified64.6%
cos-atan64.4%
hypot-1-def64.4%
div-inv64.4%
add-sqr-sqrt30.8%
sqrt-unprod57.6%
sqr-neg57.6%
sqrt-unprod33.6%
add-sqr-sqrt64.4%
clear-num64.4%
Applied egg-rr64.4%
Final simplification64.4%
(FPCore (eh ew t)
:precision binary64
(if (or (<= eh -3e-32) (not (<= eh 2.65e+54)))
(fabs (* ew (cos (atan (/ (* (tan t) eh) ew)))))
(fabs
(+
(/ (* t t) (/ ew (* eh eh)))
(* ew (* (cos t) (/ -1.0 (hypot 1.0 (/ (- t) (/ ew eh))))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -3e-32) || !(eh <= 2.65e+54)) {
tmp = fabs((ew * cos(atan(((tan(t) * eh) / ew)))));
} else {
tmp = fabs((((t * t) / (ew / (eh * eh))) + (ew * (cos(t) * (-1.0 / hypot(1.0, (-t / (ew / eh))))))));
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -3e-32) || !(eh <= 2.65e+54)) {
tmp = Math.abs((ew * Math.cos(Math.atan(((Math.tan(t) * eh) / ew)))));
} else {
tmp = Math.abs((((t * t) / (ew / (eh * eh))) + (ew * (Math.cos(t) * (-1.0 / Math.hypot(1.0, (-t / (ew / eh))))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -3e-32) or not (eh <= 2.65e+54): tmp = math.fabs((ew * math.cos(math.atan(((math.tan(t) * eh) / ew))))) else: tmp = math.fabs((((t * t) / (ew / (eh * eh))) + (ew * (math.cos(t) * (-1.0 / math.hypot(1.0, (-t / (ew / eh)))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -3e-32) || !(eh <= 2.65e+54)) tmp = abs(Float64(ew * cos(atan(Float64(Float64(tan(t) * eh) / ew))))); else tmp = abs(Float64(Float64(Float64(t * t) / Float64(ew / Float64(eh * eh))) + Float64(ew * Float64(cos(t) * Float64(-1.0 / hypot(1.0, Float64(Float64(-t) / Float64(ew / eh)))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -3e-32) || ~((eh <= 2.65e+54))) tmp = abs((ew * cos(atan(((tan(t) * eh) / ew))))); else tmp = abs((((t * t) / (ew / (eh * eh))) + (ew * (cos(t) * (-1.0 / hypot(1.0, (-t / (ew / eh)))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -3e-32], N[Not[LessEqual[eh, 2.65e+54]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(t * t), $MachinePrecision] / N[(ew / N[(eh * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(ew * N[(N[Cos[t], $MachinePrecision] * N[(-1.0 / N[Sqrt[1.0 ^ 2 + N[((-t) / N[(ew / eh), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -3 \cdot 10^{-32} \lor \neg \left(eh \leq 2.65 \cdot 10^{+54}\right):\\
\;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{t \cdot t}{\frac{ew}{eh \cdot eh}} + ew \cdot \left(\cos t \cdot \frac{-1}{\mathsf{hypot}\left(1, \frac{-t}{\frac{ew}{eh}}\right)}\right)\right|\\
\end{array}
\end{array}
if eh < -3e-32 or 2.65000000000000009e54 < eh Initial program 99.8%
fabs-neg99.8%
sub0-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
Simplified99.8%
sin-mult45.1%
associate-*r/45.1%
Applied egg-rr41.9%
+-inverses41.9%
*-commutative41.9%
associate-/l*41.9%
div041.9%
Simplified41.9%
expm1-log1p-u41.9%
add-sqr-sqrt27.2%
sqrt-unprod28.8%
sqr-neg28.8%
sqrt-unprod14.8%
add-sqr-sqrt41.9%
div-inv41.9%
clear-num41.9%
Applied egg-rr41.9%
Taylor expanded in t around 0 31.8%
if -3e-32 < eh < 2.65000000000000009e54Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
Taylor expanded in t around 0 88.4%
mul-1-neg88.4%
associate-/l*88.4%
distribute-neg-frac88.4%
Simplified88.4%
associate-*r*88.4%
sin-atan86.2%
associate-*r/86.2%
div-inv86.1%
add-sqr-sqrt38.6%
sqrt-unprod83.4%
sqr-neg83.4%
sqrt-unprod47.6%
add-sqr-sqrt85.5%
clear-num85.6%
hypot-1-def87.7%
div-inv87.7%
Applied egg-rr87.7%
associate-/l*87.7%
associate-/r/87.7%
*-commutative87.7%
associate-*l/87.7%
associate-*r/87.7%
*-commutative87.7%
associate-*l/87.7%
associate-*r/87.7%
Simplified87.7%
Taylor expanded in t around 0 66.8%
associate-/l*66.5%
unpow266.5%
unpow266.5%
Simplified66.5%
cos-atan66.5%
hypot-1-def66.5%
Applied egg-rr66.5%
Final simplification50.1%
(FPCore (eh ew t) :precision binary64 (* (fabs ew) (fabs (/ 1.0 (hypot 1.0 (* (/ (tan t) ew) eh))))))
double code(double eh, double ew, double t) {
return fabs(ew) * fabs((1.0 / hypot(1.0, ((tan(t) / ew) * eh))));
}
public static double code(double eh, double ew, double t) {
return Math.abs(ew) * Math.abs((1.0 / Math.hypot(1.0, ((Math.tan(t) / ew) * eh))));
}
def code(eh, ew, t): return math.fabs(ew) * math.fabs((1.0 / math.hypot(1.0, ((math.tan(t) / ew) * eh))))
function code(eh, ew, t) return Float64(abs(ew) * abs(Float64(1.0 / hypot(1.0, Float64(Float64(tan(t) / ew) * eh))))) end
function tmp = code(eh, ew, t) tmp = abs(ew) * abs((1.0 / hypot(1.0, ((tan(t) / ew) * eh)))); end
code[eh_, ew_, t_] := N[(N[Abs[ew], $MachinePrecision] * N[Abs[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left|ew\right| \cdot \left|\frac{1}{\mathsf{hypot}\left(1, \frac{\tan t}{ew} \cdot eh\right)}\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
sin-mult66.1%
associate-*r/66.1%
Applied egg-rr64.6%
+-inverses64.6%
*-commutative64.6%
associate-/l*64.6%
div064.6%
Simplified64.6%
Taylor expanded in t around 0 45.0%
*-commutative45.0%
*-commutative45.0%
associate-*r/45.0%
associate-*l*45.0%
neg-mul-145.0%
*-commutative45.0%
associate-*l/45.0%
distribute-rgt-neg-in45.0%
Simplified45.0%
distribute-frac-neg45.0%
*-commutative45.0%
associate-*r/45.0%
distribute-lft-neg-out45.0%
cos-atan44.8%
hypot-1-def44.8%
add-sqr-sqrt23.3%
sqrt-unprod39.5%
sqr-neg39.5%
sqrt-unprod21.5%
add-sqr-sqrt44.8%
associate-*r/44.8%
*-commutative44.8%
associate-*r/44.8%
frac-2neg44.8%
metadata-eval44.8%
Applied egg-rr44.8%
/-rgt-identity44.8%
/-rgt-identity44.8%
*-commutative44.8%
associate-*l/44.8%
associate-*r/44.8%
Simplified44.8%
Final simplification44.8%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (* (cos t) (cos (atan (/ (- t) (/ ew eh))))))))
double code(double eh, double ew, double t) {
return fabs((ew * (cos(t) * cos(atan((-t / (ew / eh)))))));
}
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 * (cos(t) * cos(atan((-t / (ew / eh)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (Math.cos(t) * Math.cos(Math.atan((-t / (ew / eh)))))));
}
def code(eh, ew, t): return math.fabs((ew * (math.cos(t) * math.cos(math.atan((-t / (ew / eh)))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(cos(t) * cos(atan(Float64(Float64(-t) / Float64(ew / eh))))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (cos(t) * cos(atan((-t / (ew / eh))))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[((-t) / N[(ew / eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{-t}{\frac{ew}{eh}}\right)\right)\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
sin-mult66.1%
associate-*r/66.1%
Applied egg-rr64.6%
+-inverses64.6%
*-commutative64.6%
associate-/l*64.6%
div064.6%
Simplified64.6%
Taylor expanded in t around 0 54.3%
mul-1-neg88.8%
associate-/l*88.8%
distribute-neg-frac88.8%
Simplified54.3%
Final simplification54.3%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos (atan (/ (* t (- eh)) ew))))))
double code(double eh, double ew, double t) {
return fabs((ew * cos(atan(((t * -eh) / 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((ew * cos(atan(((t * -eh) / ew)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.cos(Math.atan(((t * -eh) / ew)))));
}
def code(eh, ew, t): return math.fabs((ew * math.cos(math.atan(((t * -eh) / ew)))))
function code(eh, ew, t) return abs(Float64(ew * cos(atan(Float64(Float64(t * Float64(-eh)) / ew))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * cos(atan(((t * -eh) / ew))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[N[ArcTan[N[(N[(t * (-eh)), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
sin-mult66.1%
associate-*r/66.1%
Applied egg-rr64.6%
+-inverses64.6%
*-commutative64.6%
associate-/l*64.6%
div064.6%
Simplified64.6%
Taylor expanded in t around 0 45.0%
*-commutative45.0%
*-commutative45.0%
associate-*r/45.0%
associate-*l*45.0%
neg-mul-145.0%
*-commutative45.0%
associate-*l/45.0%
distribute-rgt-neg-in45.0%
Simplified45.0%
Taylor expanded in t around 0 43.7%
Final simplification43.7%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (/ 1.0 (hypot 1.0 (/ (- eh) (/ ew t)))))))
double code(double eh, double ew, double t) {
return fabs((ew * (1.0 / hypot(1.0, (-eh / (ew / t))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (1.0 / Math.hypot(1.0, (-eh / (ew / t))))));
}
def code(eh, ew, t): return math.fabs((ew * (1.0 / math.hypot(1.0, (-eh / (ew / t))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(1.0 / hypot(1.0, Float64(Float64(-eh) / Float64(ew / t)))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (1.0 / hypot(1.0, (-eh / (ew / t)))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[((-eh) / N[(ew / t), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, \frac{-eh}{\frac{ew}{t}}\right)}\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
sin-mult66.1%
associate-*r/66.1%
Applied egg-rr64.6%
+-inverses64.6%
*-commutative64.6%
associate-/l*64.6%
div064.6%
Simplified64.6%
Taylor expanded in t around 0 45.0%
*-commutative45.0%
*-commutative45.0%
associate-*r/45.0%
associate-*l*45.0%
neg-mul-145.0%
*-commutative45.0%
associate-*l/45.0%
distribute-rgt-neg-in45.0%
Simplified45.0%
Taylor expanded in t around 0 43.7%
cos-atan42.4%
*-commutative42.4%
*-commutative42.4%
Applied egg-rr42.4%
hypot-1-def42.5%
distribute-lft-neg-in42.5%
associate-/l*42.6%
Simplified42.6%
Final simplification42.6%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (/ 1.0 (hypot 1.0 (* t (/ eh ew)))))))
double code(double eh, double ew, double t) {
return fabs((ew * (1.0 / hypot(1.0, (t * (eh / ew))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (1.0 / Math.hypot(1.0, (t * (eh / ew))))));
}
def code(eh, ew, t): return math.fabs((ew * (1.0 / math.hypot(1.0, (t * (eh / ew))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(1.0 / hypot(1.0, Float64(t * Float64(eh / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (1.0 / hypot(1.0, (t * (eh / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \frac{1}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{ew}\right)}\right|
\end{array}
Initial program 99.7%
fabs-neg99.7%
sub0-neg99.7%
sub-neg99.7%
+-commutative99.7%
associate--r+99.7%
Simplified99.7%
sin-mult66.1%
associate-*r/66.1%
Applied egg-rr64.6%
+-inverses64.6%
*-commutative64.6%
associate-/l*64.6%
div064.6%
Simplified64.6%
Taylor expanded in t around 0 45.0%
*-commutative45.0%
*-commutative45.0%
associate-*r/45.0%
associate-*l*45.0%
neg-mul-145.0%
*-commutative45.0%
associate-*l/45.0%
distribute-rgt-neg-in45.0%
Simplified45.0%
Taylor expanded in t around 0 43.7%
cos-atan42.4%
*-commutative42.4%
*-commutative42.4%
Applied egg-rr42.4%
distribute-frac-neg42.4%
associate-*r/42.4%
distribute-frac-neg42.4%
associate-*r/42.6%
sqr-neg42.6%
hypot-1-def42.6%
associate-*r/42.5%
*-commutative42.5%
*-lft-identity42.5%
times-frac42.6%
/-rgt-identity42.6%
Simplified42.6%
Final simplification42.6%
herbie shell --seed 2023187
(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)))))))