
(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 17 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 (<= (* z 3.0) -0.5) (+ x (fma -0.3333333333333333 (/ y z) (/ t (* 3.0 (* z y))))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -0.5) {
tmp = x + fma(-0.3333333333333333, (y / z), (t / (3.0 * (z * y))));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -0.5) tmp = Float64(x + fma(-0.3333333333333333, Float64(y / z), Float64(t / Float64(3.0 * Float64(z * y))))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -0.5], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + N[(t / N[(3.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -0.5:\\
\;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{3 \cdot \left(z \cdot y\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (*.f64 z 3) < -0.5Initial program 98.1%
associate-+l-98.1%
sub-neg98.1%
remove-double-neg98.1%
distribute-neg-in98.1%
*-lft-identity98.1%
metadata-eval98.1%
times-frac98.1%
neg-mul-198.1%
distribute-rgt-neg-out98.1%
associate-*r/98.1%
neg-mul-198.1%
distribute-neg-out98.1%
neg-mul-198.1%
distribute-lft-neg-in98.1%
metadata-eval98.1%
*-lft-identity98.1%
Simplified99.7%
Taylor expanded in y around 0 99.7%
if -0.5 < (*.f64 z 3) Initial program 95.5%
associate-*l*95.5%
*-commutative95.5%
Simplified95.5%
*-commutative95.5%
associate-*l*95.5%
associate-+l-95.5%
*-commutative95.5%
associate-/r*97.4%
sub-div98.4%
Applied egg-rr98.4%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (* z 3.0) -1e+131) (not (<= (* z 3.0) 1e+128))) (+ x (* y (/ -0.3333333333333333 z))) (* 0.3333333333333333 (/ (- (/ t y) y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -1e+131) || !((z * 3.0) <= 1e+128)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (((t / y) - 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 * 3.0d0) <= (-1d+131)) .or. (.not. ((z * 3.0d0) <= 1d+128))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -1e+131) || !((z * 3.0) <= 1e+128)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * 3.0) <= -1e+131) or not ((z * 3.0) <= 1e+128): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = 0.3333333333333333 * (((t / y) - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * 3.0) <= -1e+131) || !(Float64(z * 3.0) <= 1e+128)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * 3.0) <= -1e+131) || ~(((z * 3.0) <= 1e+128))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = 0.3333333333333333 * (((t / y) - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -1e+131], N[Not[LessEqual[N[(z * 3.0), $MachinePrecision], 1e+128]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+131} \lor \neg \left(z \cdot 3 \leq 10^{+128}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\end{array}
\end{array}
if (*.f64 z 3) < -9.9999999999999991e130 or 1.0000000000000001e128 < (*.f64 z 3) Initial program 97.2%
Simplified92.0%
Taylor expanded in t around 0 83.5%
*-commutative83.5%
associate-*l/83.7%
associate-*r/83.6%
Simplified83.6%
if -9.9999999999999991e130 < (*.f64 z 3) < 1.0000000000000001e128Initial program 95.6%
associate-*l*95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in z around 0 86.4%
distribute-lft-out--86.4%
*-un-lft-identity86.4%
times-frac86.4%
metadata-eval86.4%
Applied egg-rr86.4%
Final simplification85.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ (- y) z) 3.0)))
(if (<= y -4.4e+28)
t_1
(if (<= y -0.0006)
x
(if (<= y 4.6e-10) (* t (/ (/ 0.3333333333333333 z) y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (-y / z) / 3.0;
double tmp;
if (y <= -4.4e+28) {
tmp = t_1;
} else if (y <= -0.0006) {
tmp = x;
} else if (y <= 4.6e-10) {
tmp = t * ((0.3333333333333333 / z) / y);
} else {
tmp = t_1;
}
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 = (-y / z) / 3.0d0
if (y <= (-4.4d+28)) then
tmp = t_1
else if (y <= (-0.0006d0)) then
tmp = x
else if (y <= 4.6d-10) then
tmp = t * ((0.3333333333333333d0 / z) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (-y / z) / 3.0;
double tmp;
if (y <= -4.4e+28) {
tmp = t_1;
} else if (y <= -0.0006) {
tmp = x;
} else if (y <= 4.6e-10) {
tmp = t * ((0.3333333333333333 / z) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (-y / z) / 3.0 tmp = 0 if y <= -4.4e+28: tmp = t_1 elif y <= -0.0006: tmp = x elif y <= 4.6e-10: tmp = t * ((0.3333333333333333 / z) / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(-y) / z) / 3.0) tmp = 0.0 if (y <= -4.4e+28) tmp = t_1; elseif (y <= -0.0006) tmp = x; elseif (y <= 4.6e-10) tmp = Float64(t * Float64(Float64(0.3333333333333333 / z) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (-y / z) / 3.0; tmp = 0.0; if (y <= -4.4e+28) tmp = t_1; elseif (y <= -0.0006) tmp = x; elseif (y <= 4.6e-10) tmp = t * ((0.3333333333333333 / z) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[((-y) / z), $MachinePrecision] / 3.0), $MachinePrecision]}, If[LessEqual[y, -4.4e+28], t$95$1, If[LessEqual[y, -0.0006], x, If[LessEqual[y, 4.6e-10], N[(t * N[(N[(0.3333333333333333 / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{-y}{z}}{3}\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -0.0006:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-10}:\\
\;\;\;\;t \cdot \frac{\frac{0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.39999999999999973e28 or 4.60000000000000014e-10 < y Initial program 96.9%
associate-*l*96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in z around 0 74.8%
Taylor expanded in t around 0 68.2%
*-commutative68.2%
Simplified68.2%
*-commutative68.2%
associate-*l/68.1%
Applied egg-rr68.1%
*-commutative68.1%
div-inv68.1%
metadata-eval68.1%
distribute-lft-neg-in68.1%
div-inv68.1%
distribute-rgt-neg-in68.1%
metadata-eval68.1%
associate-/r*67.4%
*-commutative67.4%
div-inv67.5%
associate-/r*68.3%
distribute-neg-frac68.3%
Applied egg-rr68.3%
if -4.39999999999999973e28 < y < -5.99999999999999947e-4Initial program 99.8%
Simplified99.8%
Taylor expanded in x around inf 69.8%
if -5.99999999999999947e-4 < y < 4.60000000000000014e-10Initial program 94.8%
associate-*l*94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in z around 0 72.4%
Taylor expanded in t around inf 67.7%
*-commutative67.7%
associate-*r/67.7%
div-inv66.9%
associate-*l*68.4%
Applied egg-rr68.4%
associate-*l/69.4%
*-lft-identity69.4%
Simplified69.4%
Final simplification68.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ (- y) z) 3.0)))
(if (<= y -4.7e+28)
t_1
(if (<= y -0.00072)
x
(if (<= y 4.2e-10) (* (/ t z) (/ 0.3333333333333333 y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (-y / z) / 3.0;
double tmp;
if (y <= -4.7e+28) {
tmp = t_1;
} else if (y <= -0.00072) {
tmp = x;
} else if (y <= 4.2e-10) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = t_1;
}
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 = (-y / z) / 3.0d0
if (y <= (-4.7d+28)) then
tmp = t_1
else if (y <= (-0.00072d0)) then
tmp = x
else if (y <= 4.2d-10) then
tmp = (t / z) * (0.3333333333333333d0 / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (-y / z) / 3.0;
double tmp;
if (y <= -4.7e+28) {
tmp = t_1;
} else if (y <= -0.00072) {
tmp = x;
} else if (y <= 4.2e-10) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (-y / z) / 3.0 tmp = 0 if y <= -4.7e+28: tmp = t_1 elif y <= -0.00072: tmp = x elif y <= 4.2e-10: tmp = (t / z) * (0.3333333333333333 / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(-y) / z) / 3.0) tmp = 0.0 if (y <= -4.7e+28) tmp = t_1; elseif (y <= -0.00072) tmp = x; elseif (y <= 4.2e-10) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (-y / z) / 3.0; tmp = 0.0; if (y <= -4.7e+28) tmp = t_1; elseif (y <= -0.00072) tmp = x; elseif (y <= 4.2e-10) tmp = (t / z) * (0.3333333333333333 / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[((-y) / z), $MachinePrecision] / 3.0), $MachinePrecision]}, If[LessEqual[y, -4.7e+28], t$95$1, If[LessEqual[y, -0.00072], x, If[LessEqual[y, 4.2e-10], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{-y}{z}}{3}\\
\mathbf{if}\;y \leq -4.7 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -0.00072:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.69999999999999965e28 or 4.2e-10 < y Initial program 96.9%
associate-*l*96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in z around 0 74.8%
Taylor expanded in t around 0 68.2%
*-commutative68.2%
Simplified68.2%
*-commutative68.2%
associate-*l/68.1%
Applied egg-rr68.1%
*-commutative68.1%
div-inv68.1%
metadata-eval68.1%
distribute-lft-neg-in68.1%
div-inv68.1%
distribute-rgt-neg-in68.1%
metadata-eval68.1%
associate-/r*67.4%
*-commutative67.4%
div-inv67.5%
associate-/r*68.3%
distribute-neg-frac68.3%
Applied egg-rr68.3%
if -4.69999999999999965e28 < y < -7.20000000000000045e-4Initial program 99.8%
Simplified99.8%
Taylor expanded in x around inf 69.8%
if -7.20000000000000045e-4 < y < 4.2e-10Initial program 94.8%
associate-*l*94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in z around 0 72.4%
Taylor expanded in t around inf 67.7%
associate-*r/68.5%
*-commutative68.5%
associate-/l/69.3%
times-frac72.6%
Applied egg-rr72.6%
Final simplification70.2%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -4e+14) (+ (- x (/ y (* z 3.0))) (/ t (* z (* 3.0 y)))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -4e+14) {
tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y)));
} else {
tmp = x + (((t / y) - 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 ((z * 3.0d0) <= (-4d+14)) then
tmp = (x - (y / (z * 3.0d0))) + (t / (z * (3.0d0 * y)))
else
tmp = x + (((t / y) - 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 ((z * 3.0) <= -4e+14) {
tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y)));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -4e+14: tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y))) else: tmp = x + (((t / y) - y) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -4e+14) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(z * Float64(3.0 * y)))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -4e+14) tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y))); else tmp = x + (((t / y) - y) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -4e+14], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z * N[(3.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -4 \cdot 10^{+14}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(3 \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (*.f64 z 3) < -4e14Initial program 98.1%
associate-*l*98.0%
*-commutative98.0%
Simplified98.0%
if -4e14 < (*.f64 z 3) Initial program 95.5%
associate-*l*95.5%
*-commutative95.5%
Simplified95.5%
*-commutative95.5%
associate-*l*95.5%
associate-+l-95.5%
*-commutative95.5%
associate-/r*97.4%
sub-div98.4%
Applied egg-rr98.4%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -4e+14) (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -4e+14) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x + (((t / y) - 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 ((z * 3.0d0) <= (-4d+14)) then
tmp = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
else
tmp = x + (((t / y) - 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 ((z * 3.0) <= -4e+14) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -4e+14: tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)) else: tmp = x + (((t / y) - y) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -4e+14) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -4e+14) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); else tmp = x + (((t / y) - y) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -4e+14], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -4 \cdot 10^{+14}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (*.f64 z 3) < -4e14Initial program 98.1%
if -4e14 < (*.f64 z 3) Initial program 95.5%
associate-*l*95.5%
*-commutative95.5%
Simplified95.5%
*-commutative95.5%
associate-*l*95.5%
associate-+l-95.5%
*-commutative95.5%
associate-/r*97.4%
sub-div98.4%
Applied egg-rr98.4%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -2e+120) x (if (<= (* z 3.0) 1e+49) (/ (- y) (* z 3.0)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -2e+120) {
tmp = x;
} else if ((z * 3.0) <= 1e+49) {
tmp = -y / (z * 3.0);
} 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 ((z * 3.0d0) <= (-2d+120)) then
tmp = x
else if ((z * 3.0d0) <= 1d+49) then
tmp = -y / (z * 3.0d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -2e+120) {
tmp = x;
} else if ((z * 3.0) <= 1e+49) {
tmp = -y / (z * 3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -2e+120: tmp = x elif (z * 3.0) <= 1e+49: tmp = -y / (z * 3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -2e+120) tmp = x; elseif (Float64(z * 3.0) <= 1e+49) tmp = Float64(Float64(-y) / Float64(z * 3.0)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -2e+120) tmp = x; elseif ((z * 3.0) <= 1e+49) tmp = -y / (z * 3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -2e+120], x, If[LessEqual[N[(z * 3.0), $MachinePrecision], 1e+49], N[((-y) / N[(z * 3.0), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -2 \cdot 10^{+120}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \cdot 3 \leq 10^{+49}:\\
\;\;\;\;\frac{-y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 z 3) < -2e120 or 9.99999999999999946e48 < (*.f64 z 3) Initial program 97.7%
Simplified92.5%
Taylor expanded in x around inf 55.0%
if -2e120 < (*.f64 z 3) < 9.99999999999999946e48Initial program 95.1%
associate-*l*95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in z around 0 89.0%
Taylor expanded in t around 0 46.6%
*-commutative46.6%
Simplified46.6%
*-commutative46.6%
associate-*l/46.6%
Applied egg-rr46.6%
*-commutative46.6%
div-inv46.6%
metadata-eval46.6%
distribute-lft-neg-in46.6%
div-inv46.6%
distribute-rgt-neg-in46.6%
metadata-eval46.6%
associate-/r*46.6%
*-commutative46.6%
div-inv46.6%
distribute-neg-frac46.6%
Applied egg-rr46.6%
Final simplification49.6%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -2e+120) x (if (<= (* z 3.0) 1e+49) (/ (/ (- y) z) 3.0) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -2e+120) {
tmp = x;
} else if ((z * 3.0) <= 1e+49) {
tmp = (-y / z) / 3.0;
} 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 ((z * 3.0d0) <= (-2d+120)) then
tmp = x
else if ((z * 3.0d0) <= 1d+49) then
tmp = (-y / z) / 3.0d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -2e+120) {
tmp = x;
} else if ((z * 3.0) <= 1e+49) {
tmp = (-y / z) / 3.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -2e+120: tmp = x elif (z * 3.0) <= 1e+49: tmp = (-y / z) / 3.0 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -2e+120) tmp = x; elseif (Float64(z * 3.0) <= 1e+49) tmp = Float64(Float64(Float64(-y) / z) / 3.0); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -2e+120) tmp = x; elseif ((z * 3.0) <= 1e+49) tmp = (-y / z) / 3.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -2e+120], x, If[LessEqual[N[(z * 3.0), $MachinePrecision], 1e+49], N[(N[((-y) / z), $MachinePrecision] / 3.0), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -2 \cdot 10^{+120}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \cdot 3 \leq 10^{+49}:\\
\;\;\;\;\frac{\frac{-y}{z}}{3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 z 3) < -2e120 or 9.99999999999999946e48 < (*.f64 z 3) Initial program 97.7%
Simplified92.5%
Taylor expanded in x around inf 55.0%
if -2e120 < (*.f64 z 3) < 9.99999999999999946e48Initial program 95.1%
associate-*l*95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in z around 0 89.0%
Taylor expanded in t around 0 46.6%
*-commutative46.6%
Simplified46.6%
*-commutative46.6%
associate-*l/46.6%
Applied egg-rr46.6%
*-commutative46.6%
div-inv46.6%
metadata-eval46.6%
distribute-lft-neg-in46.6%
div-inv46.6%
distribute-rgt-neg-in46.6%
metadata-eval46.6%
associate-/r*46.6%
*-commutative46.6%
div-inv46.6%
associate-/r*46.6%
distribute-neg-frac46.6%
Applied egg-rr46.6%
Final simplification49.6%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -2e+120) x (if (<= (* z 3.0) 1e+49) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -2e+120) {
tmp = x;
} else if ((z * 3.0) <= 1e+49) {
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 ((z * 3.0d0) <= (-2d+120)) then
tmp = x
else if ((z * 3.0d0) <= 1d+49) 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 ((z * 3.0) <= -2e+120) {
tmp = x;
} else if ((z * 3.0) <= 1e+49) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -2e+120: tmp = x elif (z * 3.0) <= 1e+49: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -2e+120) tmp = x; elseif (Float64(z * 3.0) <= 1e+49) 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 ((z * 3.0) <= -2e+120) tmp = x; elseif ((z * 3.0) <= 1e+49) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -2e+120], x, If[LessEqual[N[(z * 3.0), $MachinePrecision], 1e+49], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -2 \cdot 10^{+120}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \cdot 3 \leq 10^{+49}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 z 3) < -2e120 or 9.99999999999999946e48 < (*.f64 z 3) Initial program 97.7%
Simplified92.5%
Taylor expanded in x around inf 55.0%
if -2e120 < (*.f64 z 3) < 9.99999999999999946e48Initial program 95.1%
associate-*l*95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in z around 0 89.0%
Taylor expanded in t around 0 46.6%
*-commutative46.6%
Simplified46.6%
associate-/l*46.6%
associate-/r/46.6%
Applied egg-rr46.6%
Final simplification49.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.1e+28)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 4.6e-10)
(+ x (* 0.3333333333333333 (/ (/ t z) y)))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e+28) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 4.6e-10) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} 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.1d+28)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 4.6d-10) then
tmp = x + (0.3333333333333333d0 * ((t / z) / y))
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.1e+28) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 4.6e-10) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.1e+28: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 4.6e-10: tmp = x + (0.3333333333333333 * ((t / z) / y)) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e+28) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 4.6e-10) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); 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.1e+28) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 4.6e-10) tmp = x + (0.3333333333333333 * ((t / z) / y)); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e+28], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e-10], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $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.1 \cdot 10^{+28}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-10}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -3.1000000000000001e28Initial program 96.7%
associate-*l*96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in t around 0 93.6%
if -3.1000000000000001e28 < y < 4.60000000000000014e-10Initial program 95.1%
Simplified92.9%
Taylor expanded in t around inf 89.8%
associate-*r/90.5%
*-commutative90.5%
associate-/r*93.5%
associate-*r/93.5%
*-rgt-identity93.5%
associate-*r/92.8%
associate-*l*92.1%
associate-*r/92.9%
*-rgt-identity92.9%
Simplified92.9%
if 4.60000000000000014e-10 < y Initial program 97.1%
Simplified99.8%
Taylor expanded in t around 0 92.4%
*-commutative92.4%
associate-*l/92.5%
associate-*r/92.5%
Simplified92.5%
clear-num92.5%
un-div-inv92.5%
div-inv92.6%
metadata-eval92.6%
Applied egg-rr92.6%
Final simplification93.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e+28)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 4.4e-10)
(+ x (/ 0.3333333333333333 (/ y (/ t z))))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+28) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 4.4e-10) {
tmp = x + (0.3333333333333333 / (y / (t / 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.7d+28)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 4.4d-10) then
tmp = x + (0.3333333333333333d0 / (y / (t / 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.7e+28) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 4.4e-10) {
tmp = x + (0.3333333333333333 / (y / (t / z)));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+28: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 4.4e-10: tmp = x + (0.3333333333333333 / (y / (t / z))) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+28) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 4.4e-10) tmp = Float64(x + Float64(0.3333333333333333 / Float64(y / Float64(t / 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.7e+28) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 4.4e-10) tmp = x + (0.3333333333333333 / (y / (t / z))); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+28], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e-10], N[(x + N[(0.3333333333333333 / N[(y / N[(t / 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.7 \cdot 10^{+28}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{0.3333333333333333}{\frac{y}{\frac{t}{z}}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -1.7e28Initial program 96.7%
associate-*l*96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in t around 0 93.6%
if -1.7e28 < y < 4.3999999999999998e-10Initial program 95.1%
Simplified92.9%
Taylor expanded in t around inf 89.8%
associate-*r/90.5%
*-commutative90.5%
associate-/r*93.5%
associate-*r/93.5%
*-rgt-identity93.5%
associate-*r/92.8%
associate-*l*92.1%
associate-*r/92.9%
*-rgt-identity92.9%
Simplified92.9%
clear-num92.8%
un-div-inv93.5%
Applied egg-rr93.5%
if 4.3999999999999998e-10 < y Initial program 97.1%
Simplified99.8%
Taylor expanded in t around 0 92.4%
*-commutative92.4%
associate-*l/92.5%
associate-*r/92.5%
Simplified92.5%
clear-num92.5%
un-div-inv92.5%
div-inv92.6%
metadata-eval92.6%
Applied egg-rr92.6%
Final simplification93.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.15e-73) (not (<= y 4e-10))) (+ x (* y (/ -0.3333333333333333 z))) (* (/ t z) (/ 0.3333333333333333 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.15e-73) || !(y <= 4e-10)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = (t / z) * (0.3333333333333333 / y);
}
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.15d-73)) .or. (.not. (y <= 4d-10))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = (t / z) * (0.3333333333333333d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.15e-73) || !(y <= 4e-10)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = (t / z) * (0.3333333333333333 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.15e-73) or not (y <= 4e-10): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = (t / z) * (0.3333333333333333 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.15e-73) || !(y <= 4e-10)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.15e-73) || ~((y <= 4e-10))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = (t / z) * (0.3333333333333333 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.15e-73], N[Not[LessEqual[y, 4e-10]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-73} \lor \neg \left(y \leq 4 \cdot 10^{-10}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\end{array}
\end{array}
if y < -1.14999999999999994e-73 or 4.00000000000000015e-10 < y Initial program 96.7%
Simplified99.8%
Taylor expanded in t around 0 89.7%
*-commutative89.7%
associate-*l/89.8%
associate-*r/89.7%
Simplified89.7%
if -1.14999999999999994e-73 < y < 4.00000000000000015e-10Initial program 95.1%
associate-*l*95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in z around 0 73.1%
Taylor expanded in t around inf 70.6%
associate-*r/71.5%
*-commutative71.5%
associate-/l/72.4%
times-frac76.1%
Applied egg-rr76.1%
Final simplification84.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.5e-73)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 3.7e-10)
(* (/ t z) (/ 0.3333333333333333 y))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e-73) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 3.7e-10) {
tmp = (t / z) * (0.3333333333333333 / y);
} 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 <= (-2.5d-73)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (y <= 3.7d-10) then
tmp = (t / z) * (0.3333333333333333d0 / y)
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 <= -2.5e-73) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 3.7e-10) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.5e-73: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 3.7e-10: tmp = (t / z) * (0.3333333333333333 / y) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.5e-73) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 3.7e-10) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); 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 <= -2.5e-73) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 3.7e-10) tmp = (t / z) * (0.3333333333333333 / y); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e-73], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e-10], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-73}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-10}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -2.4999999999999999e-73Initial program 96.3%
Simplified99.7%
Taylor expanded in t around 0 87.5%
*-commutative87.5%
associate-*l/87.5%
associate-*r/87.4%
Simplified87.4%
if -2.4999999999999999e-73 < y < 3.70000000000000015e-10Initial program 95.1%
associate-*l*95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in z around 0 73.1%
Taylor expanded in t around inf 70.6%
associate-*r/71.5%
*-commutative71.5%
associate-/l/72.4%
times-frac76.1%
Applied egg-rr76.1%
if 3.70000000000000015e-10 < y Initial program 97.1%
Simplified99.8%
Taylor expanded in t around 0 92.4%
*-commutative92.4%
associate-*l/92.5%
associate-*r/92.5%
Simplified92.5%
clear-num92.5%
un-div-inv92.5%
div-inv92.6%
metadata-eval92.6%
Applied egg-rr92.6%
Final simplification84.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.65e-75)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 3.7e-10)
(* (/ t z) (/ 0.3333333333333333 y))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.65e-75) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 3.7e-10) {
tmp = (t / z) * (0.3333333333333333 / y);
} 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.65d-75)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 3.7d-10) then
tmp = (t / z) * (0.3333333333333333d0 / y)
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.65e-75) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 3.7e-10) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.65e-75: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 3.7e-10: tmp = (t / z) * (0.3333333333333333 / y) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.65e-75) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 3.7e-10) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); 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.65e-75) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 3.7e-10) tmp = (t / z) * (0.3333333333333333 / y); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.65e-75], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e-10], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-75}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-10}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -1.65e-75Initial program 96.3%
associate-*l*96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in t around 0 87.5%
if -1.65e-75 < y < 3.70000000000000015e-10Initial program 95.1%
associate-*l*95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in z around 0 73.1%
Taylor expanded in t around inf 70.6%
associate-*r/71.5%
*-commutative71.5%
associate-/l/72.4%
times-frac76.1%
Applied egg-rr76.1%
if 3.70000000000000015e-10 < y Initial program 97.1%
Simplified99.8%
Taylor expanded in t around 0 92.4%
*-commutative92.4%
associate-*l/92.5%
associate-*r/92.5%
Simplified92.5%
clear-num92.5%
un-div-inv92.5%
div-inv92.6%
metadata-eval92.6%
Applied egg-rr92.6%
Final simplification84.3%
(FPCore (x y z t) :precision binary64 (if (<= z -4.8e+117) x (if (<= z 3.2e+50) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.8e+117) {
tmp = x;
} else if (z <= 3.2e+50) {
tmp = y * (-0.3333333333333333 / 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 (z <= (-4.8d+117)) then
tmp = x
else if (z <= 3.2d+50) then
tmp = y * ((-0.3333333333333333d0) / 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 (z <= -4.8e+117) {
tmp = x;
} else if (z <= 3.2e+50) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.8e+117: tmp = x elif z <= 3.2e+50: tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.8e+117) tmp = x; elseif (z <= 3.2e+50) tmp = Float64(y * Float64(-0.3333333333333333 / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.8e+117) tmp = x; elseif (z <= 3.2e+50) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.8e+117], x, If[LessEqual[z, 3.2e+50], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+117}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+50}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.7999999999999998e117 or 3.19999999999999983e50 < z Initial program 97.7%
Simplified92.5%
Taylor expanded in x around inf 55.0%
if -4.7999999999999998e117 < z < 3.19999999999999983e50Initial program 95.1%
associate-*l*95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in z around 0 89.0%
Taylor expanded in t around 0 46.6%
*-commutative46.6%
Simplified46.6%
*-commutative46.6%
associate-*l/46.6%
Applied egg-rr46.6%
Final simplification49.6%
(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 96.1%
Simplified96.5%
Final simplification96.5%
(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 96.1%
Simplified96.5%
Taylor expanded in x around inf 26.8%
Final simplification26.8%
(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 2024020
(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))))