?

Average Error: 0.1 → 0.1
Time: 19.6s
Precision: binary64
Cost: 79104

?

\[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\\ \left|\left(ew \cdot \cos t\right) \cdot \left(\frac{1 + \cos \left(t_1 \cdot -2\right)}{2} \cdot \frac{1}{\cos t_1}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (-
   (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew))))
   (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* eh (- (tan t))) ew))))
   (fabs
    (-
     (*
      (* ew (cos t))
      (* (/ (+ 1.0 (cos (* t_1 -2.0))) 2.0) (/ 1.0 (cos t_1))))
     (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew))))))))
double code(double eh, double ew, double t) {
	return fabs((((ew * cos(t)) * cos(atan(((-eh * tan(t)) / ew)))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew))))));
}
double code(double eh, double ew, double t) {
	double t_1 = atan(((eh * -tan(t)) / ew));
	return fabs((((ew * cos(t)) * (((1.0 + cos((t_1 * -2.0))) / 2.0) * (1.0 / cos(t_1)))) - ((eh * sin(t)) * sin(atan(((-eh * tan(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((((ew * cos(t)) * cos(atan(((-eh * tan(t)) / ew)))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew))))))
end function
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)) * (((1.0d0 + cos((t_1 * (-2.0d0)))) / 2.0d0) * (1.0d0 / cos(t_1)))) - ((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(((-eh * Math.tan(t)) / ew)))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((-eh * Math.tan(t)) / ew))))));
}
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)) * (((1.0 + Math.cos((t_1 * -2.0))) / 2.0) * (1.0 / Math.cos(t_1)))) - ((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(((-eh * math.tan(t)) / ew)))) - ((eh * math.sin(t)) * math.sin(math.atan(((-eh * math.tan(t)) / ew))))))
def code(eh, ew, t):
	t_1 = math.atan(((eh * -math.tan(t)) / ew))
	return math.fabs((((ew * math.cos(t)) * (((1.0 + math.cos((t_1 * -2.0))) / 2.0) * (1.0 / math.cos(t_1)))) - ((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(Float64(-eh) * tan(t)) / ew)))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))))))
end
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(eh * Float64(-tan(t))) / ew))
	return abs(Float64(Float64(Float64(ew * cos(t)) * Float64(Float64(Float64(1.0 + cos(Float64(t_1 * -2.0))) / 2.0) * Float64(1.0 / cos(t_1)))) - 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(((-eh * tan(t)) / ew)))) - ((eh * sin(t)) * sin(atan(((-eh * tan(t)) / ew))))));
end
function tmp = code(eh, ew, t)
	t_1 = atan(((eh * -tan(t)) / ew));
	tmp = abs((((ew * cos(t)) * (((1.0 + cos((t_1 * -2.0))) / 2.0) * (1.0 / cos(t_1)))) - ((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[((-eh) * N[Tan[t], $MachinePrecision]), $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]
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[(N[(N[(1.0 + N[Cos[N[(t$95$1 * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] * N[(1.0 / N[Cos[t$95$1], $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{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \left(\frac{1 + \cos \left(t_1 \cdot -2\right)}{2} \cdot \frac{1}{\cos t_1}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.1

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Applied egg-rr0.1

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\left(\frac{1 + \cos \left(\tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right) \cdot -2\right)}{2} \cdot \frac{1}{\cos \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  3. Final simplification0.1

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \left(\frac{1 + \cos \left(\tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right) \cdot -2\right)}{2} \cdot \frac{1}{\cos \tan^{-1} \left(\frac{eh \cdot \left(-\tan t\right)}{ew}\right)}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]

Alternatives

Alternative 1
Error0.1
Cost58944
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|ew \cdot \left(\cos t \cdot \cos t_1\right) - eh \cdot \left(\sin t \cdot \sin t_1\right)\right| \end{array} \]
Alternative 2
Error0.6
Cost52544
\[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right| \]
Alternative 3
Error6.2
Cost46144
\[\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\right| \]
Alternative 4
Error12.6
Cost46016
\[\left|ew \cdot \cos \tan^{-1} \left(-\frac{\tan t \cdot eh}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right| \]
Alternative 5
Error13.3
Cost39616
\[\left|ew \cdot \cos \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right| \]

Error

Reproduce?

herbie shell --seed 2023077 
(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)))))))