
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= t -7e+111) (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) (+ x (* -0.3333333333333333 (/ (- y (/ t y)) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7e+111) {
tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
} else {
tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-7d+111)) then
tmp = (x - (y / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))
else
tmp = x + ((-0.3333333333333333d0) * ((y - (t / y)) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7e+111) {
tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
} else {
tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -7e+111: tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))) else: tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -7e+111) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))); else tmp = Float64(x + Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -7e+111) tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); else tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -7e+111], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+111}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + -0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\
\end{array}
\end{array}
if t < -7.0000000000000004e111Initial program 99.7%
if -7.0000000000000004e111 < t Initial program 94.8%
Simplified98.4%
Taylor expanded in x around 0 98.4%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.3333333333333333 (/ t (* y z))))
(t_2 (* -0.3333333333333333 (/ y z))))
(if (<= y -1.65e+87)
t_2
(if (<= y -4.8e+56)
x
(if (<= y -1.1e+46)
t_2
(if (<= y 7.4e-223)
t_1
(if (<= y 1.95e-190) x (if (<= y 2.15e-48) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = 0.3333333333333333 * (t / (y * z));
double t_2 = -0.3333333333333333 * (y / z);
double tmp;
if (y <= -1.65e+87) {
tmp = t_2;
} else if (y <= -4.8e+56) {
tmp = x;
} else if (y <= -1.1e+46) {
tmp = t_2;
} else if (y <= 7.4e-223) {
tmp = t_1;
} else if (y <= 1.95e-190) {
tmp = x;
} else if (y <= 2.15e-48) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.3333333333333333d0 * (t / (y * z))
t_2 = (-0.3333333333333333d0) * (y / z)
if (y <= (-1.65d+87)) then
tmp = t_2
else if (y <= (-4.8d+56)) then
tmp = x
else if (y <= (-1.1d+46)) then
tmp = t_2
else if (y <= 7.4d-223) then
tmp = t_1
else if (y <= 1.95d-190) then
tmp = x
else if (y <= 2.15d-48) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 0.3333333333333333 * (t / (y * z));
double t_2 = -0.3333333333333333 * (y / z);
double tmp;
if (y <= -1.65e+87) {
tmp = t_2;
} else if (y <= -4.8e+56) {
tmp = x;
} else if (y <= -1.1e+46) {
tmp = t_2;
} else if (y <= 7.4e-223) {
tmp = t_1;
} else if (y <= 1.95e-190) {
tmp = x;
} else if (y <= 2.15e-48) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 0.3333333333333333 * (t / (y * z)) t_2 = -0.3333333333333333 * (y / z) tmp = 0 if y <= -1.65e+87: tmp = t_2 elif y <= -4.8e+56: tmp = x elif y <= -1.1e+46: tmp = t_2 elif y <= 7.4e-223: tmp = t_1 elif y <= 1.95e-190: tmp = x elif y <= 2.15e-48: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(0.3333333333333333 * Float64(t / Float64(y * z))) t_2 = Float64(-0.3333333333333333 * Float64(y / z)) tmp = 0.0 if (y <= -1.65e+87) tmp = t_2; elseif (y <= -4.8e+56) tmp = x; elseif (y <= -1.1e+46) tmp = t_2; elseif (y <= 7.4e-223) tmp = t_1; elseif (y <= 1.95e-190) tmp = x; elseif (y <= 2.15e-48) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 0.3333333333333333 * (t / (y * z)); t_2 = -0.3333333333333333 * (y / z); tmp = 0.0; if (y <= -1.65e+87) tmp = t_2; elseif (y <= -4.8e+56) tmp = x; elseif (y <= -1.1e+46) tmp = t_2; elseif (y <= 7.4e-223) tmp = t_1; elseif (y <= 1.95e-190) tmp = x; elseif (y <= 2.15e-48) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.65e+87], t$95$2, If[LessEqual[y, -4.8e+56], x, If[LessEqual[y, -1.1e+46], t$95$2, If[LessEqual[y, 7.4e-223], t$95$1, If[LessEqual[y, 1.95e-190], x, If[LessEqual[y, 2.15e-48], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
t_2 := -0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+87}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{+56}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{+46}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-190}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-48}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.6500000000000001e87 or -4.80000000000000027e56 < y < -1.1e46 or 2.15e-48 < y Initial program 99.2%
Simplified99.8%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 77.7%
Taylor expanded in y around inf 72.0%
*-commutative72.0%
Simplified72.0%
if -1.6500000000000001e87 < y < -4.80000000000000027e56 or 7.3999999999999997e-223 < y < 1.94999999999999997e-190Initial program 100.0%
Simplified100.0%
Taylor expanded in x around inf 91.7%
if -1.1e46 < y < 7.3999999999999997e-223 or 1.94999999999999997e-190 < y < 2.15e-48Initial program 92.0%
Simplified92.1%
Taylor expanded in x around 0 92.2%
Taylor expanded in z around 0 70.0%
Taylor expanded in y around 0 65.8%
Final simplification69.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.3333333333333333 (/ t (* y z))))
(t_2 (+ x (/ y (* z -3.0)))))
(if (<= y -4.3e-17)
t_2
(if (<= y 7.4e-223)
t_1
(if (<= y 1.95e-190) x (if (<= y 1.9e-49) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = 0.3333333333333333 * (t / (y * z));
double t_2 = x + (y / (z * -3.0));
double tmp;
if (y <= -4.3e-17) {
tmp = t_2;
} else if (y <= 7.4e-223) {
tmp = t_1;
} else if (y <= 1.95e-190) {
tmp = x;
} else if (y <= 1.9e-49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.3333333333333333d0 * (t / (y * z))
t_2 = x + (y / (z * (-3.0d0)))
if (y <= (-4.3d-17)) then
tmp = t_2
else if (y <= 7.4d-223) then
tmp = t_1
else if (y <= 1.95d-190) then
tmp = x
else if (y <= 1.9d-49) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 0.3333333333333333 * (t / (y * z));
double t_2 = x + (y / (z * -3.0));
double tmp;
if (y <= -4.3e-17) {
tmp = t_2;
} else if (y <= 7.4e-223) {
tmp = t_1;
} else if (y <= 1.95e-190) {
tmp = x;
} else if (y <= 1.9e-49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 0.3333333333333333 * (t / (y * z)) t_2 = x + (y / (z * -3.0)) tmp = 0 if y <= -4.3e-17: tmp = t_2 elif y <= 7.4e-223: tmp = t_1 elif y <= 1.95e-190: tmp = x elif y <= 1.9e-49: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(0.3333333333333333 * Float64(t / Float64(y * z))) t_2 = Float64(x + Float64(y / Float64(z * -3.0))) tmp = 0.0 if (y <= -4.3e-17) tmp = t_2; elseif (y <= 7.4e-223) tmp = t_1; elseif (y <= 1.95e-190) tmp = x; elseif (y <= 1.9e-49) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 0.3333333333333333 * (t / (y * z)); t_2 = x + (y / (z * -3.0)); tmp = 0.0; if (y <= -4.3e-17) tmp = t_2; elseif (y <= 7.4e-223) tmp = t_1; elseif (y <= 1.95e-190) tmp = x; elseif (y <= 1.9e-49) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.3e-17], t$95$2, If[LessEqual[y, 7.4e-223], t$95$1, If[LessEqual[y, 1.95e-190], x, If[LessEqual[y, 1.9e-49], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
t_2 := x + \frac{y}{z \cdot -3}\\
\mathbf{if}\;y \leq -4.3 \cdot 10^{-17}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-190}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -4.30000000000000023e-17 or 1.8999999999999999e-49 < y Initial program 99.3%
Simplified99.8%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
unpow-199.7%
Simplified99.7%
Taylor expanded in y around inf 91.8%
*-commutative91.8%
associate-/r/91.8%
metadata-eval91.8%
associate-/l*91.9%
/-rgt-identity91.9%
Simplified91.9%
if -4.30000000000000023e-17 < y < 7.3999999999999997e-223 or 1.94999999999999997e-190 < y < 1.8999999999999999e-49Initial program 91.3%
Simplified91.4%
Taylor expanded in x around 0 91.5%
Taylor expanded in z around 0 70.7%
Taylor expanded in y around 0 67.9%
if 7.3999999999999997e-223 < y < 1.94999999999999997e-190Initial program 100.0%
Simplified100.0%
Taylor expanded in x around inf 85.8%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.3333333333333333 (/ t (* y z)))))
(if (<= y -3.6e-17)
(- x (/ (* y 0.3333333333333333) z))
(if (<= y 7.4e-223)
t_1
(if (<= y 1.2e-187)
x
(if (<= y 1.3e-53) t_1 (+ x (/ y (* z -3.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 0.3333333333333333 * (t / (y * z));
double tmp;
if (y <= -3.6e-17) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 7.4e-223) {
tmp = t_1;
} else if (y <= 1.2e-187) {
tmp = x;
} else if (y <= 1.3e-53) {
tmp = t_1;
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.3333333333333333d0 * (t / (y * z))
if (y <= (-3.6d-17)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if (y <= 7.4d-223) then
tmp = t_1
else if (y <= 1.2d-187) then
tmp = x
else if (y <= 1.3d-53) then
tmp = t_1
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 0.3333333333333333 * (t / (y * z));
double tmp;
if (y <= -3.6e-17) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 7.4e-223) {
tmp = t_1;
} else if (y <= 1.2e-187) {
tmp = x;
} else if (y <= 1.3e-53) {
tmp = t_1;
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = 0.3333333333333333 * (t / (y * z)) tmp = 0 if y <= -3.6e-17: tmp = x - ((y * 0.3333333333333333) / z) elif y <= 7.4e-223: tmp = t_1 elif y <= 1.2e-187: tmp = x elif y <= 1.3e-53: tmp = t_1 else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) t_1 = Float64(0.3333333333333333 * Float64(t / Float64(y * z))) tmp = 0.0 if (y <= -3.6e-17) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (y <= 7.4e-223) tmp = t_1; elseif (y <= 1.2e-187) tmp = x; elseif (y <= 1.3e-53) tmp = t_1; else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 0.3333333333333333 * (t / (y * z)); tmp = 0.0; if (y <= -3.6e-17) tmp = x - ((y * 0.3333333333333333) / z); elseif (y <= 7.4e-223) tmp = t_1; elseif (y <= 1.2e-187) tmp = x; elseif (y <= 1.3e-53) tmp = t_1; else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e-17], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.4e-223], t$95$1, If[LessEqual[y, 1.2e-187], x, If[LessEqual[y, 1.3e-53], t$95$1, N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{-17}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-187}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -3.59999999999999995e-17Initial program 98.7%
Taylor expanded in t around 0 92.4%
associate-*r/92.5%
Applied egg-rr92.5%
if -3.59999999999999995e-17 < y < 7.3999999999999997e-223 or 1.20000000000000007e-187 < y < 1.29999999999999998e-53Initial program 91.3%
Simplified91.4%
Taylor expanded in x around 0 91.5%
Taylor expanded in z around 0 70.7%
Taylor expanded in y around 0 67.9%
if 7.3999999999999997e-223 < y < 1.20000000000000007e-187Initial program 100.0%
Simplified100.0%
Taylor expanded in x around inf 85.8%
if 1.29999999999999998e-53 < y Initial program 99.8%
Simplified99.7%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
Taylor expanded in y around inf 91.2%
*-commutative91.2%
associate-/r/91.3%
metadata-eval91.3%
associate-/l*91.4%
/-rgt-identity91.4%
Simplified91.4%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.2e-17)
(- x (/ (* y 0.3333333333333333) z))
(if (<= y 7.4e-223)
(* -0.3333333333333333 (/ (/ (- t) y) z))
(if (<= y 1.95e-190)
x
(if (<= y 2.9e-52)
(* 0.3333333333333333 (/ t (* y z)))
(+ x (/ y (* z -3.0))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.2e-17) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 7.4e-223) {
tmp = -0.3333333333333333 * ((-t / y) / z);
} else if (y <= 1.95e-190) {
tmp = x;
} else if (y <= 2.9e-52) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.2d-17)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if (y <= 7.4d-223) then
tmp = (-0.3333333333333333d0) * ((-t / y) / z)
else if (y <= 1.95d-190) then
tmp = x
else if (y <= 2.9d-52) then
tmp = 0.3333333333333333d0 * (t / (y * z))
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.2e-17) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 7.4e-223) {
tmp = -0.3333333333333333 * ((-t / y) / z);
} else if (y <= 1.95e-190) {
tmp = x;
} else if (y <= 2.9e-52) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.2e-17: tmp = x - ((y * 0.3333333333333333) / z) elif y <= 7.4e-223: tmp = -0.3333333333333333 * ((-t / y) / z) elif y <= 1.95e-190: tmp = x elif y <= 2.9e-52: tmp = 0.3333333333333333 * (t / (y * z)) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.2e-17) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (y <= 7.4e-223) tmp = Float64(-0.3333333333333333 * Float64(Float64(Float64(-t) / y) / z)); elseif (y <= 1.95e-190) tmp = x; elseif (y <= 2.9e-52) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.2e-17) tmp = x - ((y * 0.3333333333333333) / z); elseif (y <= 7.4e-223) tmp = -0.3333333333333333 * ((-t / y) / z); elseif (y <= 1.95e-190) tmp = x; elseif (y <= 2.9e-52) tmp = 0.3333333333333333 * (t / (y * z)); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.2e-17], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.4e-223], N[(-0.3333333333333333 * N[(N[((-t) / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e-190], x, If[LessEqual[y, 2.9e-52], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{-17}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{\frac{-t}{y}}{z}\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-190}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-52}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -3.2000000000000002e-17Initial program 98.7%
Taylor expanded in t around 0 92.4%
associate-*r/92.5%
Applied egg-rr92.5%
if -3.2000000000000002e-17 < y < 7.3999999999999997e-223Initial program 92.6%
Simplified93.6%
Taylor expanded in x around 0 93.7%
Taylor expanded in z around 0 70.8%
Taylor expanded in y around 0 68.6%
neg-mul-168.6%
associate-/r*69.7%
distribute-neg-frac69.7%
Simplified69.7%
if 7.3999999999999997e-223 < y < 1.94999999999999997e-190Initial program 100.0%
Simplified100.0%
Taylor expanded in x around inf 85.8%
if 1.94999999999999997e-190 < y < 2.9000000000000002e-52Initial program 86.0%
Simplified82.3%
Taylor expanded in x around 0 82.4%
Taylor expanded in z around 0 70.4%
Taylor expanded in y around 0 65.0%
if 2.9000000000000002e-52 < y Initial program 99.8%
Simplified99.7%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
Taylor expanded in y around inf 91.2%
*-commutative91.2%
associate-/r/91.3%
metadata-eval91.3%
associate-/l*91.4%
/-rgt-identity91.4%
Simplified91.4%
Final simplification81.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.5e+53)
(+ x (/ y (* z -3.0)))
(if (<= z 1.85e+105)
(* -0.3333333333333333 (/ (- y (/ t y)) z))
(- x (* 0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e+53) {
tmp = x + (y / (z * -3.0));
} else if (z <= 1.85e+105) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.5d+53)) then
tmp = x + (y / (z * (-3.0d0)))
else if (z <= 1.85d+105) then
tmp = (-0.3333333333333333d0) * ((y - (t / y)) / z)
else
tmp = x - (0.3333333333333333d0 * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e+53) {
tmp = x + (y / (z * -3.0));
} else if (z <= 1.85e+105) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.5e+53: tmp = x + (y / (z * -3.0)) elif z <= 1.85e+105: tmp = -0.3333333333333333 * ((y - (t / y)) / z) else: tmp = x - (0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.5e+53) tmp = Float64(x + Float64(y / Float64(z * -3.0))); elseif (z <= 1.85e+105) tmp = Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z)); else tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.5e+53) tmp = x + (y / (z * -3.0)); elseif (z <= 1.85e+105) tmp = -0.3333333333333333 * ((y - (t / y)) / z); else tmp = x - (0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.5e+53], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+105], N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+53}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+105}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -5.49999999999999975e53Initial program 98.6%
Simplified88.0%
clear-num87.9%
inv-pow87.9%
Applied egg-rr87.9%
unpow-187.9%
Simplified87.9%
Taylor expanded in y around inf 77.8%
*-commutative77.8%
associate-/r/77.9%
metadata-eval77.9%
associate-/l*78.0%
/-rgt-identity78.0%
Simplified78.0%
if -5.49999999999999975e53 < z < 1.84999999999999992e105Initial program 93.7%
Simplified99.8%
Taylor expanded in x around 0 99.8%
Taylor expanded in z around 0 90.4%
if 1.84999999999999992e105 < z Initial program 99.7%
Taylor expanded in t around 0 75.2%
Final simplification85.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -5e+44)
(- x (/ (* y 0.3333333333333333) z))
(if (<= y 3.2e-46)
(+ x (* (/ t y) (/ 0.3333333333333333 z)))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5e+44) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 3.2e-46) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5d+44)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if (y <= 3.2d-46) then
tmp = x + ((t / y) * (0.3333333333333333d0 / z))
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5e+44) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 3.2e-46) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5e+44: tmp = x - ((y * 0.3333333333333333) / z) elif y <= 3.2e-46: tmp = x + ((t / y) * (0.3333333333333333 / z)) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5e+44) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (y <= 3.2e-46) tmp = Float64(x + Float64(Float64(t / y) * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5e+44) tmp = x - ((y * 0.3333333333333333) / z); elseif (y <= 3.2e-46) tmp = x + ((t / y) * (0.3333333333333333 / z)); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5e+44], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-46], N[(x + N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+44}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-46}:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -4.9999999999999996e44Initial program 98.4%
Taylor expanded in t around 0 98.4%
associate-*r/98.5%
Applied egg-rr98.5%
if -4.9999999999999996e44 < y < 3.1999999999999999e-46Initial program 92.5%
Simplified92.5%
Taylor expanded in y around 0 89.6%
associate-*r/89.5%
*-commutative89.5%
times-frac89.0%
*-commutative89.0%
Simplified89.0%
if 3.1999999999999999e-46 < y Initial program 99.8%
Simplified99.7%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
Taylor expanded in y around inf 91.2%
*-commutative91.2%
associate-/r/91.3%
metadata-eval91.3%
associate-/l*91.4%
/-rgt-identity91.4%
Simplified91.4%
Final simplification91.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.6e+50)
(- x (/ (* y 0.3333333333333333) z))
(if (<= y 2.6e-47)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e+50) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 2.6e-47) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.6d+50)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if (y <= 2.6d-47) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e+50) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 2.6e-47) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.6e+50: tmp = x - ((y * 0.3333333333333333) / z) elif y <= 2.6e-47: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.6e+50) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (y <= 2.6e-47) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.6e+50) tmp = x - ((y * 0.3333333333333333) / z); elseif (y <= 2.6e-47) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.6e+50], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e-47], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+50}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-47}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -1.59999999999999991e50Initial program 98.4%
Taylor expanded in t around 0 98.4%
associate-*r/98.5%
Applied egg-rr98.5%
if -1.59999999999999991e50 < y < 2.6e-47Initial program 92.5%
Simplified92.5%
Taylor expanded in y around 0 89.6%
if 2.6e-47 < y Initial program 99.8%
Simplified99.7%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
Taylor expanded in y around inf 91.2%
*-commutative91.2%
associate-/r/91.3%
metadata-eval91.3%
associate-/l*91.4%
/-rgt-identity91.4%
Simplified91.4%
Final simplification91.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e+40)
(- x (/ (* y 0.3333333333333333) z))
(if (<= y 3.2e-46)
(+ x (/ 0.3333333333333333 (* y (/ z t))))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+40) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 3.2e-46) {
tmp = x + (0.3333333333333333 / (y * (z / t)));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.7d+40)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if (y <= 3.2d-46) then
tmp = x + (0.3333333333333333d0 / (y * (z / t)))
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+40) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 3.2e-46) {
tmp = x + (0.3333333333333333 / (y * (z / t)));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+40: tmp = x - ((y * 0.3333333333333333) / z) elif y <= 3.2e-46: tmp = x + (0.3333333333333333 / (y * (z / t))) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+40) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (y <= 3.2e-46) tmp = Float64(x + Float64(0.3333333333333333 / Float64(y * Float64(z / t)))); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e+40) tmp = x - ((y * 0.3333333333333333) / z); elseif (y <= 3.2e-46) tmp = x + (0.3333333333333333 / (y * (z / t))); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+40], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-46], N[(x + N[(0.3333333333333333 / N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+40}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-46}:\\
\;\;\;\;x + \frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -1.69999999999999994e40Initial program 98.4%
Taylor expanded in t around 0 98.4%
associate-*r/98.5%
Applied egg-rr98.5%
if -1.69999999999999994e40 < y < 3.1999999999999999e-46Initial program 92.5%
Simplified92.5%
Taylor expanded in y around 0 89.6%
associate-*r/89.5%
*-commutative89.5%
associate-/l/88.9%
div-inv89.0%
associate-/l*88.9%
frac-times89.7%
metadata-eval89.7%
Applied egg-rr89.7%
Taylor expanded in y around 0 89.5%
*-commutative89.5%
associate-*l/94.1%
*-commutative94.1%
Simplified94.1%
if 3.1999999999999999e-46 < y Initial program 99.8%
Simplified99.7%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
Taylor expanded in y around inf 91.2%
*-commutative91.2%
associate-/r/91.3%
metadata-eval91.3%
associate-/l*91.4%
/-rgt-identity91.4%
Simplified91.4%
Final simplification94.2%
(FPCore (x y z t) :precision binary64 (+ x (* (- y (/ t y)) (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) * (-0.3333333333333333 / z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - (t / y)) * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + ((y - (t / y)) * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - Float64(t / y)) * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 95.8%
Simplified96.1%
Final simplification96.1%
(FPCore (x y z t) :precision binary64 (+ x (* -0.3333333333333333 (/ (- y (/ t y)) z))))
double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 * ((y - (t / y)) / z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((-0.3333333333333333d0) * ((y - (t / y)) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 * ((y - (t / y)) / z));
}
def code(x, y, z, t): return x + (-0.3333333333333333 * ((y - (t / y)) / z))
function code(x, y, z, t) return Float64(x + Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z))) end
function tmp = code(x, y, z, t) tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z)); end
code[x_, y_, z_, t_] := N[(x + N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + -0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}
\end{array}
Initial program 95.8%
Simplified96.1%
Taylor expanded in x around 0 96.1%
Final simplification96.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.25e+88) (not (<= y 5.5e-26))) (* -0.3333333333333333 (/ y z)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.25e+88) || !(y <= 5.5e-26)) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.25d+88)) .or. (.not. (y <= 5.5d-26))) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.25e+88) || !(y <= 5.5e-26)) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.25e+88) or not (y <= 5.5e-26): tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.25e+88) || !(y <= 5.5e-26)) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.25e+88) || ~((y <= 5.5e-26))) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.25e+88], N[Not[LessEqual[y, 5.5e-26]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+88} \lor \neg \left(y \leq 5.5 \cdot 10^{-26}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.24999999999999999e88 or 5.5000000000000005e-26 < y Initial program 99.2%
Simplified99.8%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 79.1%
Taylor expanded in y around inf 73.1%
*-commutative73.1%
Simplified73.1%
if -1.24999999999999999e88 < y < 5.5000000000000005e-26Initial program 93.0%
Simplified93.1%
Taylor expanded in x around inf 31.5%
Final simplification50.0%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.8%
Simplified96.1%
Taylor expanded in x around inf 27.4%
Final simplification27.4%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2023268
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))