?

Average Error: 0.1 → 0.1
Time: 49.5s
Precision: binary64
Cost: 58944

?

\[\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{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\cos t \cdot \left(ew \cdot \cos t_1\right) - eh \cdot \left(\sin t \cdot \sin t_1\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 (- (* (cos t) (* ew (cos t_1))) (* eh (* (sin t) (sin t_1)))))))
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(((cos(t) * (ew * 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
    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(((cos(t) * (ew * cos(t_1))) - (eh * (sin(t) * sin(t_1)))))
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(((Math.cos(t) * (ew * Math.cos(t_1))) - (eh * (Math.sin(t) * Math.sin(t_1)))));
}
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(((math.cos(t) * (ew * math.cos(t_1))) - (eh * (math.sin(t) * math.sin(t_1)))))
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(Float64(-eh) * tan(t)) / ew))
	return abs(Float64(Float64(cos(t) * Float64(ew * cos(t_1))) - Float64(eh * Float64(sin(t) * sin(t_1)))))
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(((cos(t) * (ew * cos(t_1))) - (eh * (sin(t) * sin(t_1)))));
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[Cos[t], $MachinePrecision] * N[(ew * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[t$95$1], $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{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\cos t \cdot \left(ew \cdot \cos t_1\right) - eh \cdot \left(\sin t \cdot \sin t_1\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. Simplified0.1

    \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \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-50 [=>]0.1

    \[ \left|\color{blue}{\cos t \cdot \left(ew \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|\cos t \cdot \left(ew \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|\cos t \cdot \left(ew \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|\cos t \cdot \left(ew \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. Final simplification0.1

    \[\leadsto \left|\cos t \cdot \left(ew \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| \]

Alternatives

Alternative 1
Error0.7
Cost52544
\[\left|\cos t \cdot \left(ew \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 2
Error10.4
Cost46664
\[\begin{array}{l} t_1 := \left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) - \sin \tan^{-1} \left(-ew \cdot \left(t \cdot \frac{\frac{eh}{ew}}{ew}\right)\right) \cdot \left(t \cdot eh\right)\right|\\ \mathbf{if}\;ew \leq -1.7 \cdot 10^{+62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;ew \leq 7.8 \cdot 10^{+86}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error10.3
Cost46664
\[\begin{array}{l} t_1 := \cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\\ \mathbf{if}\;ew \leq -9 \cdot 10^{+63}:\\ \;\;\;\;\left|t_1 - \sin \tan^{-1} \left(-ew \cdot \left(t \cdot \frac{\frac{eh}{ew}}{ew}\right)\right) \cdot \left(t \cdot eh\right)\right|\\ \mathbf{elif}\;ew \leq 1.3 \cdot 10^{+88}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) - eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t_1 - \sin \tan^{-1} \left(-ew \cdot \frac{t \cdot eh}{ew \cdot ew}\right) \cdot \left(t \cdot eh\right)\right|\\ \end{array} \]
Alternative 4
Error10.8
Cost46280
\[\begin{array}{l} t_1 := \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\\ t_2 := \sin t_1\\ t_3 := \left|\cos t \cdot \left(ew \cdot \cos t_1\right) - t_2 \cdot \left(t \cdot eh\right)\right|\\ \mathbf{if}\;ew \leq -4.8 \cdot 10^{+63}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;ew \leq 1.15 \cdot 10^{+86}:\\ \;\;\;\;\left|ew \cdot \cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) - eh \cdot \left(\sin t \cdot t_2\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 5
Error11.3
Cost40008
\[\begin{array}{l} t_1 := \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\\ t_2 := \sin t_1\\ t_3 := ew \cdot \cos t_1\\ t_4 := \left|\cos t \cdot t_3 - t_2 \cdot \left(t \cdot eh\right)\right|\\ \mathbf{if}\;ew \leq -7.8 \cdot 10^{+62}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;ew \leq 7.2 \cdot 10^{+86}:\\ \;\;\;\;\left|t_3 - eh \cdot \left(\sin t \cdot t_2\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 6
Error14.0
Cost39616
\[\begin{array}{l} t_1 := \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\\ \left|ew \cdot \cos t_1 - eh \cdot \left(\sin t \cdot \sin t_1\right)\right| \end{array} \]
Alternative 7
Error29.9
Cost33216
\[\begin{array}{l} t_1 := \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\\ \left|ew \cdot \cos t_1 - eh \cdot \left(t \cdot \sin t_1\right)\right| \end{array} \]

Error

Reproduce?

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