
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (tan((y + z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (tan((y + z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (+ (/ (tan y) (- 1.0 (/ (* (tan z) (sin y)) (cos y)))) (- (/ (tan z) (- 1.0 (* (tan y) (tan z)))) (tan a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + ((tan(y) / (1.0 - ((tan(z) * sin(y)) / cos(y)))) + ((tan(z) / (1.0 - (tan(y) * tan(z)))) - tan(a)));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + ((tan(y) / (1.0d0 - ((tan(z) * sin(y)) / cos(y)))) + ((tan(z) / (1.0d0 - (tan(y) * tan(z)))) - tan(a)))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + ((Math.tan(y) / (1.0 - ((Math.tan(z) * Math.sin(y)) / Math.cos(y)))) + ((Math.tan(z) / (1.0 - (Math.tan(y) * Math.tan(z)))) - Math.tan(a)));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + ((math.tan(y) / (1.0 - ((math.tan(z) * math.sin(y)) / math.cos(y)))) + ((math.tan(z) / (1.0 - (math.tan(y) * math.tan(z)))) - math.tan(a)))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(tan(y) / Float64(1.0 - Float64(Float64(tan(z) * sin(y)) / cos(y)))) + Float64(Float64(tan(z) / Float64(1.0 - Float64(tan(y) * tan(z)))) - tan(a)))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + ((tan(y) / (1.0 - ((tan(z) * sin(y)) / cos(y)))) + ((tan(z) / (1.0 - (tan(y) * tan(z)))) - tan(a)));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[Tan[y], $MachinePrecision] / N[(1.0 - N[(N[(N[Tan[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Tan[z], $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\frac{\tan y}{1 - \frac{\tan z \cdot \sin y}{\cos y}} + \left(\frac{\tan z}{1 - \tan y \cdot \tan z} - \tan a\right)\right)
\end{array}
Initial program 77.3%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
div-invN/A
fmm-defN/A
fma-defineN/A
*-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
+-lowering-+.f64N/A
Applied egg-rr99.7%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.7%
Applied egg-rr99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (+ (- (/ (tan z) (- 1.0 (* (tan y) (tan z)))) (tan a)) (/ (tan y) (- 1.0 (/ (* (tan y) (sin z)) (cos z)))))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (((tan(z) / (1.0 - (tan(y) * tan(z)))) - tan(a)) + (tan(y) / (1.0 - ((tan(y) * sin(z)) / cos(z)))));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (((tan(z) / (1.0d0 - (tan(y) * tan(z)))) - tan(a)) + (tan(y) / (1.0d0 - ((tan(y) * sin(z)) / cos(z)))))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (((Math.tan(z) / (1.0 - (Math.tan(y) * Math.tan(z)))) - Math.tan(a)) + (Math.tan(y) / (1.0 - ((Math.tan(y) * Math.sin(z)) / Math.cos(z)))));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (((math.tan(z) / (1.0 - (math.tan(y) * math.tan(z)))) - math.tan(a)) + (math.tan(y) / (1.0 - ((math.tan(y) * math.sin(z)) / math.cos(z)))))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(z) / Float64(1.0 - Float64(tan(y) * tan(z)))) - tan(a)) + Float64(tan(y) / Float64(1.0 - Float64(Float64(tan(y) * sin(z)) / cos(z)))))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (((tan(z) / (1.0 - (tan(y) * tan(z)))) - tan(a)) + (tan(y) / (1.0 - ((tan(y) * sin(z)) / cos(z)))));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[z], $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision] + N[(N[Tan[y], $MachinePrecision] / N[(1.0 - N[(N[(N[Tan[y], $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision] / N[Cos[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\left(\frac{\tan z}{1 - \tan y \cdot \tan z} - \tan a\right) + \frac{\tan y}{1 - \frac{\tan y \cdot \sin z}{\cos z}}\right)
\end{array}
Initial program 77.3%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
div-invN/A
fmm-defN/A
fma-defineN/A
*-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
+-lowering-+.f64N/A
Applied egg-rr99.7%
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (+ (/ (tan y) (- 1.0 (* (tan y) (tan z)))) (- (/ (tan z) (+ 1.0 (/ (tan z) (/ -1.0 (tan y))))) (tan a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + ((tan(y) / (1.0 - (tan(y) * tan(z)))) + ((tan(z) / (1.0 + (tan(z) / (-1.0 / tan(y))))) - tan(a)));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + ((tan(y) / (1.0d0 - (tan(y) * tan(z)))) + ((tan(z) / (1.0d0 + (tan(z) / ((-1.0d0) / tan(y))))) - tan(a)))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + ((Math.tan(y) / (1.0 - (Math.tan(y) * Math.tan(z)))) + ((Math.tan(z) / (1.0 + (Math.tan(z) / (-1.0 / Math.tan(y))))) - Math.tan(a)));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + ((math.tan(y) / (1.0 - (math.tan(y) * math.tan(z)))) + ((math.tan(z) / (1.0 + (math.tan(z) / (-1.0 / math.tan(y))))) - math.tan(a)))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(tan(y) / Float64(1.0 - Float64(tan(y) * tan(z)))) + Float64(Float64(tan(z) / Float64(1.0 + Float64(tan(z) / Float64(-1.0 / tan(y))))) - tan(a)))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + ((tan(y) / (1.0 - (tan(y) * tan(z)))) + ((tan(z) / (1.0 + (tan(z) / (-1.0 / tan(y))))) - tan(a)));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[Tan[y], $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Tan[z], $MachinePrecision] / N[(1.0 + N[(N[Tan[z], $MachinePrecision] / N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\frac{\tan y}{1 - \tan y \cdot \tan z} + \left(\frac{\tan z}{1 + \frac{\tan z}{\frac{-1}{\tan y}}} - \tan a\right)\right)
\end{array}
Initial program 77.3%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
div-invN/A
fmm-defN/A
fma-defineN/A
*-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
+-lowering-+.f64N/A
Applied egg-rr99.7%
*-commutativeN/A
tan-quotN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (let* ((t_0 (- 1.0 (* (tan y) (tan z))))) (+ x (+ (- (/ (tan z) t_0) (tan a)) (/ (tan y) t_0)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = 1.0 - (tan(y) * tan(z));
return x + (((tan(z) / t_0) - tan(a)) + (tan(y) / t_0));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
t_0 = 1.0d0 - (tan(y) * tan(z))
code = x + (((tan(z) / t_0) - tan(a)) + (tan(y) / t_0))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = 1.0 - (Math.tan(y) * Math.tan(z));
return x + (((Math.tan(z) / t_0) - Math.tan(a)) + (Math.tan(y) / t_0));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = 1.0 - (math.tan(y) * math.tan(z)) return x + (((math.tan(z) / t_0) - math.tan(a)) + (math.tan(y) / t_0))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(1.0 - Float64(tan(y) * tan(z))) return Float64(x + Float64(Float64(Float64(tan(z) / t_0) - tan(a)) + Float64(tan(y) / t_0))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
t_0 = 1.0 - (tan(y) * tan(z));
tmp = x + (((tan(z) / t_0) - tan(a)) + (tan(y) / t_0));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x + N[(N[(N[(N[Tan[z], $MachinePrecision] / t$95$0), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision] + N[(N[Tan[y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := 1 - \tan y \cdot \tan z\\
x + \left(\left(\frac{\tan z}{t\_0} - \tan a\right) + \frac{\tan y}{t\_0}\right)
\end{array}
\end{array}
Initial program 77.3%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
div-invN/A
fmm-defN/A
fma-defineN/A
*-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
+-lowering-+.f64N/A
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan y) (tan z))))
(if (<= (tan a) -0.005)
(+
x
(-
(/
t_0
(+ 1.0 (/ (tan y) (/ (- -1.0 (* -0.3333333333333333 (* z z))) z))))
(tan a)))
(if (<= (tan a) 1e-58)
(+ x (- (/ t_0 (- 1.0 (* (tan y) (tan z)))) a))
(+
x
(-
(/
t_0
(+
1.0
(/
(tan y)
(/
(-
-1.0
(*
(* z z)
(+
-0.3333333333333333
(*
(* z z)
(+
-0.022222222222222223
(* (* z z) -0.0021164021164021165))))))
z))))
(tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan(y) + tan(z);
double tmp;
if (tan(a) <= -0.005) {
tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
} else if (tan(a) <= 1e-58) {
tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
} else {
tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + ((z * z) * (-0.022222222222222223 + ((z * z) * -0.0021164021164021165)))))) / z)))) - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = tan(y) + tan(z)
if (tan(a) <= (-0.005d0)) then
tmp = x + ((t_0 / (1.0d0 + (tan(y) / (((-1.0d0) - ((-0.3333333333333333d0) * (z * z))) / z)))) - tan(a))
else if (tan(a) <= 1d-58) then
tmp = x + ((t_0 / (1.0d0 - (tan(y) * tan(z)))) - a)
else
tmp = x + ((t_0 / (1.0d0 + (tan(y) / (((-1.0d0) - ((z * z) * ((-0.3333333333333333d0) + ((z * z) * ((-0.022222222222222223d0) + ((z * z) * (-0.0021164021164021165d0))))))) / z)))) - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(y) + Math.tan(z);
double tmp;
if (Math.tan(a) <= -0.005) {
tmp = x + ((t_0 / (1.0 + (Math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - Math.tan(a));
} else if (Math.tan(a) <= 1e-58) {
tmp = x + ((t_0 / (1.0 - (Math.tan(y) * Math.tan(z)))) - a);
} else {
tmp = x + ((t_0 / (1.0 + (Math.tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + ((z * z) * (-0.022222222222222223 + ((z * z) * -0.0021164021164021165)))))) / z)))) - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan(y) + math.tan(z) tmp = 0 if math.tan(a) <= -0.005: tmp = x + ((t_0 / (1.0 + (math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - math.tan(a)) elif math.tan(a) <= 1e-58: tmp = x + ((t_0 / (1.0 - (math.tan(y) * math.tan(z)))) - a) else: tmp = x + ((t_0 / (1.0 + (math.tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + ((z * z) * (-0.022222222222222223 + ((z * z) * -0.0021164021164021165)))))) / z)))) - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(tan(y) + tan(z)) tmp = 0.0 if (tan(a) <= -0.005) tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 + Float64(tan(y) / Float64(Float64(-1.0 - Float64(-0.3333333333333333 * Float64(z * z))) / z)))) - tan(a))); elseif (tan(a) <= 1e-58) tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - a)); else tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 + Float64(tan(y) / Float64(Float64(-1.0 - Float64(Float64(z * z) * Float64(-0.3333333333333333 + Float64(Float64(z * z) * Float64(-0.022222222222222223 + Float64(Float64(z * z) * -0.0021164021164021165)))))) / z)))) - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan(y) + tan(z);
tmp = 0.0;
if (tan(a) <= -0.005)
tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
elseif (tan(a) <= 1e-58)
tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
else
tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + ((z * z) * (-0.022222222222222223 + ((z * z) * -0.0021164021164021165)))))) / z)))) - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.005], N[(x + N[(N[(t$95$0 / N[(1.0 + N[(N[Tan[y], $MachinePrecision] / N[(N[(-1.0 - N[(-0.3333333333333333 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 1e-58], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t$95$0 / N[(1.0 + N[(N[Tan[y], $MachinePrecision] / N[(N[(-1.0 - N[(N[(z * z), $MachinePrecision] * N[(-0.3333333333333333 + N[(N[(z * z), $MachinePrecision] * N[(-0.022222222222222223 + N[(N[(z * z), $MachinePrecision] * -0.0021164021164021165), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
\mathbf{if}\;\tan a \leq -0.005:\\
\;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\
\mathbf{elif}\;\tan a \leq 10^{-58}:\\
\;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - \left(z \cdot z\right) \cdot \left(-0.3333333333333333 + \left(z \cdot z\right) \cdot \left(-0.022222222222222223 + \left(z \cdot z\right) \cdot -0.0021164021164021165\right)\right)}{z}}} - \tan a\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -0.0050000000000000001Initial program 75.0%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
tan-quotN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.1%
Simplified76.1%
if -0.0050000000000000001 < (tan.f64 a) < 1e-58Initial program 77.1%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in a around 0
Simplified99.7%
if 1e-58 < (tan.f64 a) Initial program 79.5%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.6%
Applied egg-rr99.6%
tan-quotN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.6%
Applied egg-rr99.6%
Taylor expanded in z around 0
/-lowering-/.f64N/A
Simplified79.7%
Final simplification88.3%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan y) (tan z))))
(if (<= (tan a) -0.005)
(+
x
(-
(/
t_0
(+ 1.0 (/ (tan y) (/ (- -1.0 (* -0.3333333333333333 (* z z))) z))))
(tan a)))
(if (<= (tan a) 1e-58)
(+ x (- (/ t_0 (- 1.0 (* (tan y) (tan z)))) a))
(+
x
(-
(/
t_0
(+
1.0
(/
(tan y)
(/
(-
-1.0
(*
(* z z)
(+ -0.3333333333333333 (* z (* z -0.022222222222222223)))))
z))))
(tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan(y) + tan(z);
double tmp;
if (tan(a) <= -0.005) {
tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
} else if (tan(a) <= 1e-58) {
tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
} else {
tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + (z * (z * -0.022222222222222223))))) / z)))) - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = tan(y) + tan(z)
if (tan(a) <= (-0.005d0)) then
tmp = x + ((t_0 / (1.0d0 + (tan(y) / (((-1.0d0) - ((-0.3333333333333333d0) * (z * z))) / z)))) - tan(a))
else if (tan(a) <= 1d-58) then
tmp = x + ((t_0 / (1.0d0 - (tan(y) * tan(z)))) - a)
else
tmp = x + ((t_0 / (1.0d0 + (tan(y) / (((-1.0d0) - ((z * z) * ((-0.3333333333333333d0) + (z * (z * (-0.022222222222222223d0)))))) / z)))) - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(y) + Math.tan(z);
double tmp;
if (Math.tan(a) <= -0.005) {
tmp = x + ((t_0 / (1.0 + (Math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - Math.tan(a));
} else if (Math.tan(a) <= 1e-58) {
tmp = x + ((t_0 / (1.0 - (Math.tan(y) * Math.tan(z)))) - a);
} else {
tmp = x + ((t_0 / (1.0 + (Math.tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + (z * (z * -0.022222222222222223))))) / z)))) - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan(y) + math.tan(z) tmp = 0 if math.tan(a) <= -0.005: tmp = x + ((t_0 / (1.0 + (math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - math.tan(a)) elif math.tan(a) <= 1e-58: tmp = x + ((t_0 / (1.0 - (math.tan(y) * math.tan(z)))) - a) else: tmp = x + ((t_0 / (1.0 + (math.tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + (z * (z * -0.022222222222222223))))) / z)))) - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(tan(y) + tan(z)) tmp = 0.0 if (tan(a) <= -0.005) tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 + Float64(tan(y) / Float64(Float64(-1.0 - Float64(-0.3333333333333333 * Float64(z * z))) / z)))) - tan(a))); elseif (tan(a) <= 1e-58) tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - a)); else tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 + Float64(tan(y) / Float64(Float64(-1.0 - Float64(Float64(z * z) * Float64(-0.3333333333333333 + Float64(z * Float64(z * -0.022222222222222223))))) / z)))) - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan(y) + tan(z);
tmp = 0.0;
if (tan(a) <= -0.005)
tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
elseif (tan(a) <= 1e-58)
tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
else
tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + (z * (z * -0.022222222222222223))))) / z)))) - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.005], N[(x + N[(N[(t$95$0 / N[(1.0 + N[(N[Tan[y], $MachinePrecision] / N[(N[(-1.0 - N[(-0.3333333333333333 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 1e-58], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t$95$0 / N[(1.0 + N[(N[Tan[y], $MachinePrecision] / N[(N[(-1.0 - N[(N[(z * z), $MachinePrecision] * N[(-0.3333333333333333 + N[(z * N[(z * -0.022222222222222223), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
\mathbf{if}\;\tan a \leq -0.005:\\
\;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\
\mathbf{elif}\;\tan a \leq 10^{-58}:\\
\;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - \left(z \cdot z\right) \cdot \left(-0.3333333333333333 + z \cdot \left(z \cdot -0.022222222222222223\right)\right)}{z}}} - \tan a\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -0.0050000000000000001Initial program 75.0%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
tan-quotN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.1%
Simplified76.1%
if -0.0050000000000000001 < (tan.f64 a) < 1e-58Initial program 77.1%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in a around 0
Simplified99.7%
if 1e-58 < (tan.f64 a) Initial program 79.5%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.6%
Applied egg-rr99.6%
tan-quotN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.6%
Applied egg-rr99.6%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.7%
Simplified79.7%
Final simplification88.3%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan y) (tan z))))
(if (<= (tan a) -0.005)
(+ x (- t_0 (tan a)))
(if (<= (tan a) 1e-58)
(+ x (- (/ t_0 (- 1.0 (* (tan y) (tan z)))) a))
(fma 1.0 t_0 (- x (tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan(y) + tan(z);
double tmp;
if (tan(a) <= -0.005) {
tmp = x + (t_0 - tan(a));
} else if (tan(a) <= 1e-58) {
tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
} else {
tmp = fma(1.0, t_0, (x - tan(a)));
}
return tmp;
}
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(tan(y) + tan(z)) tmp = 0.0 if (tan(a) <= -0.005) tmp = Float64(x + Float64(t_0 - tan(a))); elseif (tan(a) <= 1e-58) tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - a)); else tmp = fma(1.0, t_0, Float64(x - tan(a))); end return tmp end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.005], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 1e-58], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(1.0 * t$95$0 + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
\mathbf{if}\;\tan a \leq -0.005:\\
\;\;\;\;x + \left(t\_0 - \tan a\right)\\
\mathbf{elif}\;\tan a \leq 10^{-58}:\\
\;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, t\_0, x - \tan a\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -0.0050000000000000001Initial program 75.0%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around 0
Simplified75.4%
if -0.0050000000000000001 < (tan.f64 a) < 1e-58Initial program 77.1%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in a around 0
Simplified99.7%
if 1e-58 < (tan.f64 a) Initial program 79.5%
+-commutativeN/A
sub-negN/A
associate-+l+N/A
tan-sumN/A
clear-numN/A
associate-/r/N/A
fma-defineN/A
fma-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-commutativeN/A
sub-negN/A
--lowering--.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around 0
Simplified79.7%
Final simplification88.2%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (/ 1.0 (/ (- 1.0 (* (tan y) (tan z))) (+ (tan y) (tan z)))) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + ((1.0 / ((1.0 - (tan(y) * tan(z))) / (tan(y) + tan(z)))) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + ((1.0d0 / ((1.0d0 - (tan(y) * tan(z))) / (tan(y) + tan(z)))) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + ((1.0 / ((1.0 - (Math.tan(y) * Math.tan(z))) / (Math.tan(y) + Math.tan(z)))) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + ((1.0 / ((1.0 - (math.tan(y) * math.tan(z))) / (math.tan(y) + math.tan(z)))) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(1.0 / Float64(Float64(1.0 - Float64(tan(y) * tan(z))) / Float64(tan(y) + tan(z)))) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + ((1.0 / ((1.0 - (tan(y) * tan(z))) / (tan(y) + tan(z)))) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(1.0 / N[(N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\frac{1}{\frac{1 - \tan y \cdot \tan z}{\tan y + \tan z}} - \tan a\right)
\end{array}
Initial program 77.3%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
tan-quotN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
clear-numN/A
/-lowering-/.f64N/A
metadata-evalN/A
associate-/r/N/A
associate-*l/N/A
div-subN/A
div-invN/A
metadata-evalN/A
associate-*r/N/A
div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (/ (+ (tan y) (tan z)) (- 1.0 (* (tan y) (tan z)))) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (((tan(y) + tan(z)) / (1.0d0 - (tan(y) * tan(z)))) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (((Math.tan(y) + Math.tan(z)) / (1.0 - (Math.tan(y) * Math.tan(z)))) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (((math.tan(y) + math.tan(z)) / (1.0 - (math.tan(y) * math.tan(z)))) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - Float64(tan(y) * tan(z)))) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)
\end{array}
Initial program 77.3%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan y) (tan z)))
(t_1
(+
x
(-
(/
t_0
(+ 1.0 (/ (tan y) (/ (- -1.0 (* -0.3333333333333333 (* z z))) z))))
(tan a)))))
(if (<= a -0.0004)
t_1
(if (<= a 2.8e-54) (+ x (- (/ t_0 (- 1.0 (* (tan y) (tan z)))) a)) t_1))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan(y) + tan(z);
double t_1 = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
double tmp;
if (a <= -0.0004) {
tmp = t_1;
} else if (a <= 2.8e-54) {
tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = tan(y) + tan(z)
t_1 = x + ((t_0 / (1.0d0 + (tan(y) / (((-1.0d0) - ((-0.3333333333333333d0) * (z * z))) / z)))) - tan(a))
if (a <= (-0.0004d0)) then
tmp = t_1
else if (a <= 2.8d-54) then
tmp = x + ((t_0 / (1.0d0 - (tan(y) * tan(z)))) - a)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(y) + Math.tan(z);
double t_1 = x + ((t_0 / (1.0 + (Math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - Math.tan(a));
double tmp;
if (a <= -0.0004) {
tmp = t_1;
} else if (a <= 2.8e-54) {
tmp = x + ((t_0 / (1.0 - (Math.tan(y) * Math.tan(z)))) - a);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan(y) + math.tan(z) t_1 = x + ((t_0 / (1.0 + (math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - math.tan(a)) tmp = 0 if a <= -0.0004: tmp = t_1 elif a <= 2.8e-54: tmp = x + ((t_0 / (1.0 - (math.tan(y) * math.tan(z)))) - a) else: tmp = t_1 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(tan(y) + tan(z)) t_1 = Float64(x + Float64(Float64(t_0 / Float64(1.0 + Float64(tan(y) / Float64(Float64(-1.0 - Float64(-0.3333333333333333 * Float64(z * z))) / z)))) - tan(a))) tmp = 0.0 if (a <= -0.0004) tmp = t_1; elseif (a <= 2.8e-54) tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - a)); else tmp = t_1; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan(y) + tan(z);
t_1 = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
tmp = 0.0;
if (a <= -0.0004)
tmp = t_1;
elseif (a <= 2.8e-54)
tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(N[(t$95$0 / N[(1.0 + N[(N[Tan[y], $MachinePrecision] / N[(N[(-1.0 - N[(-0.3333333333333333 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.0004], t$95$1, If[LessEqual[a, 2.8e-54], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
t_1 := x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\
\mathbf{if}\;a \leq -0.0004:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-54}:\\
\;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.00000000000000019e-4 or 2.8000000000000002e-54 < a Initial program 77.5%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
tan-quotN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.6%
Applied egg-rr99.6%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.1%
Simplified78.1%
if -4.00000000000000019e-4 < a < 2.8000000000000002e-54Initial program 77.1%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in a around 0
Simplified99.7%
Final simplification88.3%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (/ (sin a) (cos a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - (sin(a) / cos(a)));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - (sin(a) / cos(a)))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - (Math.sin(a) / Math.cos(a)));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (math.tan((y + z)) - (math.sin(a) / math.cos(a)))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - Float64(sin(a) / cos(a)))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (tan((y + z)) - (sin(a) / cos(a)));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sin[a], $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\tan \left(y + z\right) - \frac{\sin a}{\cos a}\right)
\end{array}
Initial program 77.3%
tan-quotN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6477.3%
Applied egg-rr77.3%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (+ (tan y) (tan z)) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + ((tan(y) + tan(z)) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + ((tan(y) + tan(z)) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + ((Math.tan(y) + Math.tan(z)) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + ((math.tan(y) + math.tan(z)) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(tan(y) + tan(z)) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + ((tan(y) + tan(z)) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\left(\tan y + \tan z\right) - \tan a\right)
\end{array}
Initial program 77.3%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around 0
Simplified77.7%
Final simplification77.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ x (- (tan y) (tan a)))))
(if (<= a -0.086)
t_0
(if (<= a 1.15e-41)
(+
x
(+
(tan (+ y z))
(*
a
(-
-1.0
(*
(* a a)
(+
0.3333333333333333
(*
(* a a)
(+ 0.13333333333333333 (* (* a a) 0.05396825396825397)))))))))
t_0))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = x + (tan(y) - tan(a));
double tmp;
if (a <= -0.086) {
tmp = t_0;
} else if (a <= 1.15e-41) {
tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = x + (tan(y) - tan(a))
if (a <= (-0.086d0)) then
tmp = t_0
else if (a <= 1.15d-41) then
tmp = x + (tan((y + z)) + (a * ((-1.0d0) - ((a * a) * (0.3333333333333333d0 + ((a * a) * (0.13333333333333333d0 + ((a * a) * 0.05396825396825397d0))))))))
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = x + (Math.tan(y) - Math.tan(a));
double tmp;
if (a <= -0.086) {
tmp = t_0;
} else if (a <= 1.15e-41) {
tmp = x + (Math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = x + (math.tan(y) - math.tan(a)) tmp = 0 if a <= -0.086: tmp = t_0 elif a <= 1.15e-41: tmp = x + (math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397)))))))) else: tmp = t_0 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(x + Float64(tan(y) - tan(a))) tmp = 0.0 if (a <= -0.086) tmp = t_0; elseif (a <= 1.15e-41) tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(Float64(a * a) * Float64(0.3333333333333333 + Float64(Float64(a * a) * Float64(0.13333333333333333 + Float64(Float64(a * a) * 0.05396825396825397))))))))); else tmp = t_0; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = x + (tan(y) - tan(a));
tmp = 0.0;
if (a <= -0.086)
tmp = t_0;
elseif (a <= 1.15e-41)
tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(N[Tan[y], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.086], t$95$0, If[LessEqual[a, 1.15e-41], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(N[(a * a), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * N[(0.13333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.05396825396825397), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := x + \left(\tan y - \tan a\right)\\
\mathbf{if}\;a \leq -0.086:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-41}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.085999999999999993 or 1.15000000000000005e-41 < a Initial program 76.5%
Taylor expanded in y around inf
Simplified57.2%
if -0.085999999999999993 < a < 1.15000000000000005e-41Initial program 78.2%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.0%
Simplified78.0%
Final simplification67.5%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (if (<= (+ y z) -1e-10) (+ x (- (tan y) (tan a))) (+ x (- (tan z) (tan a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -1e-10) {
tmp = x + (tan(y) - tan(a));
} else {
tmp = x + (tan(z) - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((y + z) <= (-1d-10)) then
tmp = x + (tan(y) - tan(a))
else
tmp = x + (tan(z) - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -1e-10) {
tmp = x + (Math.tan(y) - Math.tan(a));
} else {
tmp = x + (Math.tan(z) - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): tmp = 0 if (y + z) <= -1e-10: tmp = x + (math.tan(y) - math.tan(a)) else: tmp = x + (math.tan(z) - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) tmp = 0.0 if (Float64(y + z) <= -1e-10) tmp = Float64(x + Float64(tan(y) - tan(a))); else tmp = Float64(x + Float64(tan(z) - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
tmp = 0.0;
if ((y + z) <= -1e-10)
tmp = x + (tan(y) - tan(a));
else
tmp = x + (tan(z) - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -1e-10], N[(x + N[(N[Tan[y], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y + z \leq -1 \cdot 10^{-10}:\\
\;\;\;\;x + \left(\tan y - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan z - \tan a\right)\\
\end{array}
\end{array}
if (+.f64 y z) < -1.00000000000000004e-10Initial program 68.4%
Taylor expanded in y around inf
Simplified46.8%
if -1.00000000000000004e-10 < (+.f64 y z) Initial program 83.6%
Taylor expanded in y around 0
Simplified67.2%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (tan((y + z)) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
Initial program 77.3%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (- x (tan a))))
(if (<= a -0.47)
t_0
(if (<= a 6.5e-6)
(+
x
(+
(tan (+ y z))
(*
a
(-
-1.0
(*
(* a a)
(+
0.3333333333333333
(*
(* a a)
(+ 0.13333333333333333 (* (* a a) 0.05396825396825397)))))))))
t_0))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = x - tan(a);
double tmp;
if (a <= -0.47) {
tmp = t_0;
} else if (a <= 6.5e-6) {
tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = x - tan(a)
if (a <= (-0.47d0)) then
tmp = t_0
else if (a <= 6.5d-6) then
tmp = x + (tan((y + z)) + (a * ((-1.0d0) - ((a * a) * (0.3333333333333333d0 + ((a * a) * (0.13333333333333333d0 + ((a * a) * 0.05396825396825397d0))))))))
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = x - Math.tan(a);
double tmp;
if (a <= -0.47) {
tmp = t_0;
} else if (a <= 6.5e-6) {
tmp = x + (Math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = x - math.tan(a) tmp = 0 if a <= -0.47: tmp = t_0 elif a <= 6.5e-6: tmp = x + (math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397)))))))) else: tmp = t_0 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(x - tan(a)) tmp = 0.0 if (a <= -0.47) tmp = t_0; elseif (a <= 6.5e-6) tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(Float64(a * a) * Float64(0.3333333333333333 + Float64(Float64(a * a) * Float64(0.13333333333333333 + Float64(Float64(a * a) * 0.05396825396825397))))))))); else tmp = t_0; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = x - tan(a);
tmp = 0.0;
if (a <= -0.47)
tmp = t_0;
elseif (a <= 6.5e-6)
tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.47], t$95$0, If[LessEqual[a, 6.5e-6], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(N[(a * a), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * N[(0.13333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.05396825396825397), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := x - \tan a\\
\mathbf{if}\;a \leq -0.47:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.46999999999999997 or 6.4999999999999996e-6 < a Initial program 76.1%
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f6476.0%
Applied egg-rr76.0%
Taylor expanded in x around inf
Simplified39.4%
if -0.46999999999999997 < a < 6.4999999999999996e-6Initial program 78.5%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.4%
Simplified78.4%
Final simplification59.0%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (- x (tan a))))
(if (<= a -0.58)
t_0
(if (<= a 6.5e-6)
(+
x
(+
(tan (+ y z))
(*
a
(-
-1.0
(*
(* a a)
(+ 0.3333333333333333 (* (* a a) 0.13333333333333333)))))))
t_0))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = x - tan(a);
double tmp;
if (a <= -0.58) {
tmp = t_0;
} else if (a <= 6.5e-6) {
tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = x - tan(a)
if (a <= (-0.58d0)) then
tmp = t_0
else if (a <= 6.5d-6) then
tmp = x + (tan((y + z)) + (a * ((-1.0d0) - ((a * a) * (0.3333333333333333d0 + ((a * a) * 0.13333333333333333d0))))))
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = x - Math.tan(a);
double tmp;
if (a <= -0.58) {
tmp = t_0;
} else if (a <= 6.5e-6) {
tmp = x + (Math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = x - math.tan(a) tmp = 0 if a <= -0.58: tmp = t_0 elif a <= 6.5e-6: tmp = x + (math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333)))))) else: tmp = t_0 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(x - tan(a)) tmp = 0.0 if (a <= -0.58) tmp = t_0; elseif (a <= 6.5e-6) tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(Float64(a * a) * Float64(0.3333333333333333 + Float64(Float64(a * a) * 0.13333333333333333))))))); else tmp = t_0; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = x - tan(a);
tmp = 0.0;
if (a <= -0.58)
tmp = t_0;
elseif (a <= 6.5e-6)
tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.58], t$95$0, If[LessEqual[a, 6.5e-6], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(N[(a * a), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.13333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := x - \tan a\\
\mathbf{if}\;a \leq -0.58:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot 0.13333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.57999999999999996 or 6.4999999999999996e-6 < a Initial program 76.1%
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f6476.0%
Applied egg-rr76.0%
Taylor expanded in x around inf
Simplified39.4%
if -0.57999999999999996 < a < 6.4999999999999996e-6Initial program 78.5%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6478.3%
Simplified78.3%
Final simplification59.0%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (- x (tan a))))
(if (<= a -0.33)
t_0
(if (<= a 6.5e-6)
(+ x (+ (tan (+ y z)) (* a (- -1.0 (* a (* a 0.3333333333333333))))))
t_0))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = x - tan(a);
double tmp;
if (a <= -0.33) {
tmp = t_0;
} else if (a <= 6.5e-6) {
tmp = x + (tan((y + z)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = x - tan(a)
if (a <= (-0.33d0)) then
tmp = t_0
else if (a <= 6.5d-6) then
tmp = x + (tan((y + z)) + (a * ((-1.0d0) - (a * (a * 0.3333333333333333d0)))))
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = x - Math.tan(a);
double tmp;
if (a <= -0.33) {
tmp = t_0;
} else if (a <= 6.5e-6) {
tmp = x + (Math.tan((y + z)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = x - math.tan(a) tmp = 0 if a <= -0.33: tmp = t_0 elif a <= 6.5e-6: tmp = x + (math.tan((y + z)) + (a * (-1.0 - (a * (a * 0.3333333333333333))))) else: tmp = t_0 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(x - tan(a)) tmp = 0.0 if (a <= -0.33) tmp = t_0; elseif (a <= 6.5e-6) tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(a * Float64(a * 0.3333333333333333)))))); else tmp = t_0; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = x - tan(a);
tmp = 0.0;
if (a <= -0.33)
tmp = t_0;
elseif (a <= 6.5e-6)
tmp = x + (tan((y + z)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.33], t$95$0, If[LessEqual[a, 6.5e-6], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(a * N[(a * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := x - \tan a\\
\mathbf{if}\;a \leq -0.33:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - a \cdot \left(a \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.330000000000000016 or 6.4999999999999996e-6 < a Initial program 76.1%
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f6476.0%
Applied egg-rr76.0%
Taylor expanded in x around inf
Simplified39.4%
if -0.330000000000000016 < a < 6.4999999999999996e-6Initial program 78.5%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.0%
Simplified78.0%
Final simplification58.9%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (let* ((t_0 (- x (tan a)))) (if (<= a -0.095) t_0 (if (<= a 6.5e-6) (- (+ x (tan (+ y z))) a) t_0))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = x - tan(a);
double tmp;
if (a <= -0.095) {
tmp = t_0;
} else if (a <= 6.5e-6) {
tmp = (x + tan((y + z))) - a;
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = x - tan(a)
if (a <= (-0.095d0)) then
tmp = t_0
else if (a <= 6.5d-6) then
tmp = (x + tan((y + z))) - a
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = x - Math.tan(a);
double tmp;
if (a <= -0.095) {
tmp = t_0;
} else if (a <= 6.5e-6) {
tmp = (x + Math.tan((y + z))) - a;
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = x - math.tan(a) tmp = 0 if a <= -0.095: tmp = t_0 elif a <= 6.5e-6: tmp = (x + math.tan((y + z))) - a else: tmp = t_0 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(x - tan(a)) tmp = 0.0 if (a <= -0.095) tmp = t_0; elseif (a <= 6.5e-6) tmp = Float64(Float64(x + tan(Float64(y + z))) - a); else tmp = t_0; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = x - tan(a);
tmp = 0.0;
if (a <= -0.095)
tmp = t_0;
elseif (a <= 6.5e-6)
tmp = (x + tan((y + z))) - a;
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.095], t$95$0, If[LessEqual[a, 6.5e-6], N[(N[(x + N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision], t$95$0]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := x - \tan a\\
\mathbf{if}\;a \leq -0.095:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\
\;\;\;\;\left(x + \tan \left(y + z\right)\right) - a\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.095000000000000001 or 6.4999999999999996e-6 < a Initial program 76.1%
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f6476.0%
Applied egg-rr76.0%
Taylor expanded in x around inf
Simplified39.4%
if -0.095000000000000001 < a < 6.4999999999999996e-6Initial program 78.5%
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f6478.5%
Applied egg-rr78.5%
Taylor expanded in a around 0
Simplified77.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (let* ((t_0 (- x (tan a)))) (if (<= a -0.068) t_0 (if (<= a 6.5e-6) (+ x (- (tan (+ y z)) a)) t_0))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = x - tan(a);
double tmp;
if (a <= -0.068) {
tmp = t_0;
} else if (a <= 6.5e-6) {
tmp = x + (tan((y + z)) - a);
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = x - tan(a)
if (a <= (-0.068d0)) then
tmp = t_0
else if (a <= 6.5d-6) then
tmp = x + (tan((y + z)) - a)
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = x - Math.tan(a);
double tmp;
if (a <= -0.068) {
tmp = t_0;
} else if (a <= 6.5e-6) {
tmp = x + (Math.tan((y + z)) - a);
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = x - math.tan(a) tmp = 0 if a <= -0.068: tmp = t_0 elif a <= 6.5e-6: tmp = x + (math.tan((y + z)) - a) else: tmp = t_0 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(x - tan(a)) tmp = 0.0 if (a <= -0.068) tmp = t_0; elseif (a <= 6.5e-6) tmp = Float64(x + Float64(tan(Float64(y + z)) - a)); else tmp = t_0; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = x - tan(a);
tmp = 0.0;
if (a <= -0.068)
tmp = t_0;
elseif (a <= 6.5e-6)
tmp = x + (tan((y + z)) - a);
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.068], t$95$0, If[LessEqual[a, 6.5e-6], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := x - \tan a\\
\mathbf{if}\;a \leq -0.068:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.068000000000000005 or 6.4999999999999996e-6 < a Initial program 76.1%
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f6476.0%
Applied egg-rr76.0%
Taylor expanded in x around inf
Simplified39.4%
if -0.068000000000000005 < a < 6.4999999999999996e-6Initial program 78.5%
Taylor expanded in a around 0
Simplified77.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (- x (tan a)))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x - tan(a);
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x - tan(a)
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x - Math.tan(a);
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x - math.tan(a)
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x - tan(a)) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x - tan(a);
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x - \tan a
\end{array}
Initial program 77.3%
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f6477.3%
Applied egg-rr77.3%
Taylor expanded in x around inf
Simplified39.5%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 x)
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return x end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := x
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x
\end{array}
Initial program 77.3%
Taylor expanded in x around inf
Simplified30.5%
herbie shell --seed 2024159
(FPCore (x y z a)
:name "tan-example (used to crash)"
:precision binary64
:pre (and (and (and (or (== x 0.0) (and (<= 0.5884142 x) (<= x 505.5909))) (or (and (<= -1.796658e+308 y) (<= y -9.425585e-310)) (and (<= 1.284938e-309 y) (<= y 1.751224e+308)))) (or (and (<= -1.776707e+308 z) (<= z -8.599796e-310)) (and (<= 3.293145e-311 z) (<= z 1.725154e+308)))) (or (and (<= -1.796658e+308 a) (<= a -9.425585e-310)) (and (<= 1.284938e-309 a) (<= a 1.751224e+308))))
(+ x (- (tan (+ y z)) (tan a))))