?

Average Accuracy: 99.8% → 99.8%
Time: 21.6s
Precision: binary64
Cost: 58816

?

\[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
\[\left|\sin t \cdot \left(ew \cdot \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (+
   (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t)))))
   (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (+
   (* (sin t) (* ew (cos (atan (/ eh (* (tan t) ew))))))
   (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
	return fabs((((ew * sin(t)) * cos(atan(((eh / ew) / tan(t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
}
double code(double eh, double ew, double t) {
	return fabs(((sin(t) * (ew * cos(atan((eh / (tan(t) * ew)))))) + ((eh * cos(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 * sin(t)) * cos(atan(((eh / ew) / tan(t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))))
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(((sin(t) * (ew * cos(atan((eh / (tan(t) * ew)))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))))
end function
public static double code(double eh, double ew, double t) {
	return Math.abs((((ew * Math.sin(t)) * Math.cos(Math.atan(((eh / ew) / Math.tan(t))))) + ((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))))));
}
public static double code(double eh, double ew, double t) {
	return Math.abs(((Math.sin(t) * (ew * Math.cos(Math.atan((eh / (Math.tan(t) * ew)))))) + ((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))))));
}
def code(eh, ew, t):
	return math.fabs((((ew * math.sin(t)) * math.cos(math.atan(((eh / ew) / math.tan(t))))) + ((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
def code(eh, ew, t):
	return math.fabs(((math.sin(t) * (ew * math.cos(math.atan((eh / (math.tan(t) * ew)))))) + ((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
function code(eh, ew, t)
	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t)))))))
end
function code(eh, ew, t)
	return abs(Float64(Float64(sin(t) * Float64(ew * cos(atan(Float64(eh / Float64(tan(t) * ew)))))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t)))))))
end
function tmp = code(eh, ew, t)
	tmp = abs((((ew * sin(t)) * cos(atan(((eh / ew) / tan(t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
end
function tmp = code(eh, ew, t)
	tmp = abs(((sin(t) * (ew * cos(atan((eh / (tan(t) * ew)))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(ew * N[Cos[N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\left|\sin t \cdot \left(ew \cdot \cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 99.8%

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Taylor expanded in t around inf 99.8%

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

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

Alternatives

Alternative 1
Accuracy99.7%
Cost52608
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{1}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{\tan t}}{ew}\right)}{\sin t \cdot ew}}\right| \]
Alternative 2
Accuracy99.7%
Cost52480
\[\begin{array}{l} t_1 := \frac{\frac{eh}{ew}}{\tan t}\\ \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} t_1 + \frac{ew}{\frac{\mathsf{hypot}\left(1, t_1\right)}{\sin t}}\right| \end{array} \]
Alternative 3
Accuracy99.7%
Cost52480
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{\sin t}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{\tan t}}{ew}\right)}{ew}}\right| \]
Alternative 4
Accuracy99.0%
Cost52416
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) \cdot \left(\sin t \cdot ew\right)\right| \]
Alternative 5
Accuracy98.4%
Cost39232
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \sin t \cdot ew\right| \]
Alternative 6
Accuracy88.8%
Cost33481
\[\begin{array}{l} t_1 := eh \cdot \cos t\\ \mathbf{if}\;eh \leq -1.12 \cdot 10^{+198} \lor \neg \left(eh \leq 3.1 \cdot 10^{-58}\right):\\ \;\;\;\;\left|t_1 \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew}{t \cdot 0.16666666666666666 + \frac{1}{t}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{ew}{\frac{1}{\sin t}} + t_1 \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right|\\ \end{array} \]
Alternative 7
Accuracy83.2%
Cost33097
\[\begin{array}{l} t_1 := \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \mathbf{if}\;ew \leq -5.8 \cdot 10^{-145} \lor \neg \left(ew \leq 2.7 \cdot 10^{-167}\right):\\ \;\;\;\;\left|\sin t \cdot ew + eh \cdot t_1\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot t_1 + t \cdot ew\right|\\ \end{array} \]
Alternative 8
Accuracy82.3%
Cost32969
\[\begin{array}{l} \mathbf{if}\;ew \leq -2.5 \cdot 10^{-158} \lor \neg \left(ew \leq 5 \cdot 10^{-171}\right):\\ \;\;\;\;\left|\sin t \cdot ew + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \frac{ew}{\frac{eh}{t \cdot \left(t \cdot ew\right)}}\right|\\ \end{array} \]
Alternative 9
Accuracy88.8%
Cost32960
\[\left|\frac{ew}{\frac{1}{\sin t}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
Alternative 10
Accuracy44.6%
Cost27081
\[\begin{array}{l} \mathbf{if}\;ew \leq -1.35 \cdot 10^{+156} \lor \neg \left(ew \leq 25000\right):\\ \;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew}{\frac{eh}{t \cdot \left(t \cdot ew\right)}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \frac{t \cdot t}{eh} \cdot \left(ew \cdot ew\right)\right|\\ \end{array} \]
Alternative 11
Accuracy48.6%
Cost26816
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \frac{ew}{\frac{eh}{t \cdot \left(t \cdot ew\right)}}\right| \]
Alternative 12
Accuracy33.8%
Cost26688
\[\left|eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(ew \cdot ew\right) \cdot \left(t \cdot \frac{t}{eh}\right)\right| \]
Alternative 13
Accuracy38.1%
Cost26688
\[\left|eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew}{\frac{eh}{ew \cdot \left(t \cdot t\right)}}\right| \]
Alternative 14
Accuracy38.9%
Cost26688
\[\left|eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew}{\frac{eh}{t \cdot \left(t \cdot ew\right)}}\right| \]
Alternative 15
Accuracy33.1%
Cost20288
\[\left|\frac{t \cdot t}{eh} \cdot \left(ew \cdot ew\right) + eh \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]

Error

Reproduce?

herbie shell --seed 2023137 
(FPCore (eh ew t)
  :name "Example from Robby"
  :precision binary64
  (fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))