?

Average Error: 0.1 → 0.1
Time: 17.3s
Precision: binary64
Cost: 59008

?

\[\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| \]
\[\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) - \sin t \cdot \left(\sin \tan^{-1} \left(-1 \cdot \frac{\tan t \cdot eh}{ew}\right) \cdot eh\right)\right| \]
(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
 (fabs
  (-
   (* ew (* (cos t) (cos (atan (/ (* (- eh) (tan t)) ew)))))
   (* (sin t) (* (sin (atan (* -1.0 (/ (* (tan t) eh) ew)))) eh)))))
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) {
	return fabs(((ew * (cos(t) * cos(atan(((-eh * tan(t)) / ew))))) - (sin(t) * (sin(atan((-1.0 * ((tan(t) * eh) / 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(((-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
    code = abs(((ew * (cos(t) * cos(atan(((-eh * tan(t)) / ew))))) - (sin(t) * (sin(atan(((-1.0d0) * ((tan(t) * eh) / 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(((-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) {
	return Math.abs(((ew * (Math.cos(t) * Math.cos(Math.atan(((-eh * Math.tan(t)) / ew))))) - (Math.sin(t) * (Math.sin(Math.atan((-1.0 * ((Math.tan(t) * eh) / ew)))) * eh))));
}
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):
	return math.fabs(((ew * (math.cos(t) * math.cos(math.atan(((-eh * math.tan(t)) / ew))))) - (math.sin(t) * (math.sin(math.atan((-1.0 * ((math.tan(t) * eh) / ew)))) * eh))))
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)
	return abs(Float64(Float64(ew * Float64(cos(t) * cos(atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))))) - Float64(sin(t) * Float64(sin(atan(Float64(-1.0 * Float64(Float64(tan(t) * eh) / ew)))) * eh))))
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)
	tmp = abs(((ew * (cos(t) * cos(atan(((-eh * tan(t)) / ew))))) - (sin(t) * (sin(atan((-1.0 * ((tan(t) * eh) / ew)))) * eh))));
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_] := N[Abs[N[(N[(ew * N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t], $MachinePrecision] * N[(N[Sin[N[ArcTan[N[(-1.0 * N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $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|
\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) - \sin t \cdot \left(\sin \tan^{-1} \left(-1 \cdot \frac{\tan t \cdot eh}{ew}\right) \cdot eh\right)\right|

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. Simplified0.1

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

    [Start]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| \]

    rational_best-simplify-1 [=>]0.1

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

    rational_best-simplify-1 [=>]0.1

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

    rational_best-simplify-50 [=>]0.1

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

    rational_best-simplify-1 [=>]0.1

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

    rational_best-simplify-1 [=>]0.1

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

    rational_best-simplify-50 [=>]0.1

    \[ \left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) - \color{blue}{eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
  3. Taylor expanded in eh around 0 0.1

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

    \[\leadsto \left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) - \sin t \cdot \left(\sin \tan^{-1} \left(-1 \cdot \frac{\tan t \cdot eh}{ew}\right) \cdot eh\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.7
Cost52544
\[\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\right)\right| \]
Alternative 3
Error4.1
Cost46792
\[\begin{array}{l} t_1 := \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\\ t_2 := ew \cdot \cos t\\ t_3 := \left|t_2 \cdot \cos \tan^{-1} \left(\left(\frac{t}{ew \cdot ew} \cdot \left(-eh\right)\right) \cdot ew\right) - t_1\right|\\ \mathbf{if}\;ew \leq -200000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;ew \leq 5 \cdot 10^{-69}:\\ \;\;\;\;\left|t_2 \cdot \cos \tan^{-1} \left(\frac{\frac{t \cdot \left(eh \cdot \left(-ew\right)\right)}{-ew}}{-ew}\right) - t_1\right|\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error5.8
Cost46532
\[\begin{array}{l} t_1 := \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\\ t_2 := ew \cdot \cos t\\ \mathbf{if}\;ew \leq -5 \cdot 10^{+83}:\\ \;\;\;\;\left|t_2 \cdot \cos \tan^{-1} \left(\left(\frac{t}{ew \cdot ew} \cdot \left(-eh\right)\right) \cdot ew\right) - t_1\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t_2 \cdot \cos \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right) - t_1\right|\\ \end{array} \]
Alternative 5
Error6.5
Cost46144
\[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\right| \]
Alternative 6
Error13.1
Cost46016
\[\left|ew \cdot \cos \tan^{-1} \left(\frac{\tan t \cdot \left(-eh\right)}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\right| \]
Alternative 7
Error13.8
Cost39616
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\\ \left|ew \cdot \cos t_1 - \left(eh \cdot \sin t\right) \cdot \sin t_1\right| \end{array} \]
Alternative 8
Error29.8
Cost33216
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{t \cdot \left(-eh\right)}{ew}\right)\\ \left|ew \cdot \cos t_1 - \left(t \cdot eh\right) \cdot \sin t_1\right| \end{array} \]

Error

Reproduce?

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