
(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 20 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
(let* ((t_1 (/ y (* z 3.0))))
(if (<= y 4e-141)
(+ x (- (* (/ t z) (/ (/ 1.0 y) 3.0)) t_1))
(+ (- x t_1) (/ t (* y (* z 3.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = y / (z * 3.0);
double tmp;
if (y <= 4e-141) {
tmp = x + (((t / z) * ((1.0 / y) / 3.0)) - t_1);
} else {
tmp = (x - t_1) + (t / (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 = y / (z * 3.0d0)
if (y <= 4d-141) then
tmp = x + (((t / z) * ((1.0d0 / y) / 3.0d0)) - t_1)
else
tmp = (x - t_1) + (t / (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 = y / (z * 3.0);
double tmp;
if (y <= 4e-141) {
tmp = x + (((t / z) * ((1.0 / y) / 3.0)) - t_1);
} else {
tmp = (x - t_1) + (t / (y * (z * 3.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (z * 3.0) tmp = 0 if y <= 4e-141: tmp = x + (((t / z) * ((1.0 / y) / 3.0)) - t_1) else: tmp = (x - t_1) + (t / (y * (z * 3.0))) return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(z * 3.0)) tmp = 0.0 if (y <= 4e-141) tmp = Float64(x + Float64(Float64(Float64(t / z) * Float64(Float64(1.0 / y) / 3.0)) - t_1)); else tmp = Float64(Float64(x - t_1) + Float64(t / Float64(y * Float64(z * 3.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (z * 3.0); tmp = 0.0; if (y <= 4e-141) tmp = x + (((t / z) * ((1.0 / y) / 3.0)) - t_1); else tmp = (x - t_1) + (t / (y * (z * 3.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4e-141], N[(x + N[(N[(N[(t / z), $MachinePrecision] * N[(N[(1.0 / y), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x - t$95$1), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z \cdot 3}\\
\mathbf{if}\;y \leq 4 \cdot 10^{-141}:\\
\;\;\;\;x + \left(\frac{t}{z} \cdot \frac{\frac{1}{y}}{3} - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - t_1\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\end{array}
\end{array}
if y < 4.0000000000000002e-141Initial program 95.0%
associate-+l-95.0%
*-commutative95.0%
Simplified95.0%
associate-/r*94.5%
div-inv94.5%
times-frac97.5%
Applied egg-rr97.5%
if 4.0000000000000002e-141 < y Initial program 99.8%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.3333333333333333 (/ t (* y z)))))
(if (<= y -8.9e+179)
(/ (* y -0.3333333333333333) z)
(if (<= y -1.16e-76)
x
(if (<= y 7.5e-17)
t_1
(if (<= y 9.5e+17) x (if (<= y 5.2e+42) t_1 (/ 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 <= -8.9e+179) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= -1.16e-76) {
tmp = x;
} else if (y <= 7.5e-17) {
tmp = t_1;
} else if (y <= 9.5e+17) {
tmp = x;
} else if (y <= 5.2e+42) {
tmp = t_1;
} else {
tmp = 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 <= (-8.9d+179)) then
tmp = (y * (-0.3333333333333333d0)) / z
else if (y <= (-1.16d-76)) then
tmp = x
else if (y <= 7.5d-17) then
tmp = t_1
else if (y <= 9.5d+17) then
tmp = x
else if (y <= 5.2d+42) then
tmp = t_1
else
tmp = 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 <= -8.9e+179) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= -1.16e-76) {
tmp = x;
} else if (y <= 7.5e-17) {
tmp = t_1;
} else if (y <= 9.5e+17) {
tmp = x;
} else if (y <= 5.2e+42) {
tmp = t_1;
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = 0.3333333333333333 * (t / (y * z)) tmp = 0 if y <= -8.9e+179: tmp = (y * -0.3333333333333333) / z elif y <= -1.16e-76: tmp = x elif y <= 7.5e-17: tmp = t_1 elif y <= 9.5e+17: tmp = x elif y <= 5.2e+42: tmp = t_1 else: tmp = 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 <= -8.9e+179) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= -1.16e-76) tmp = x; elseif (y <= 7.5e-17) tmp = t_1; elseif (y <= 9.5e+17) tmp = x; elseif (y <= 5.2e+42) tmp = t_1; else tmp = 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 <= -8.9e+179) tmp = (y * -0.3333333333333333) / z; elseif (y <= -1.16e-76) tmp = x; elseif (y <= 7.5e-17) tmp = t_1; elseif (y <= 9.5e+17) tmp = x; elseif (y <= 5.2e+42) tmp = t_1; else tmp = 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, -8.9e+179], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, -1.16e-76], x, If[LessEqual[y, 7.5e-17], t$95$1, If[LessEqual[y, 9.5e+17], x, If[LessEqual[y, 5.2e+42], t$95$1, N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{if}\;y \leq -8.9 \cdot 10^{+179}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq -1.16 \cdot 10^{-76}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+17}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -8.90000000000000036e179Initial program 99.7%
Simplified99.7%
fma-udef99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 95.4%
associate-*r/95.5%
Applied egg-rr95.5%
if -8.90000000000000036e179 < y < -1.1599999999999999e-76 or 7.49999999999999984e-17 < y < 9.5e17Initial program 98.2%
Simplified98.2%
Taylor expanded in x around inf 61.0%
if -1.1599999999999999e-76 < y < 7.49999999999999984e-17 or 9.5e17 < y < 5.1999999999999998e42Initial program 94.3%
Simplified94.3%
fma-udef94.3%
Applied egg-rr94.3%
Taylor expanded in y around 0 66.4%
if 5.1999999999999998e42 < y Initial program 99.7%
Simplified99.6%
fma-udef99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 71.7%
associate-*r/71.7%
associate-*l/71.7%
*-commutative71.7%
clear-num71.6%
un-div-inv71.7%
div-inv71.8%
metadata-eval71.8%
Applied egg-rr71.8%
Final simplification68.9%
(FPCore (x y z t) :precision binary64 (+ x (+ (* -0.3333333333333333 (/ y z)) (/ t (* z (* y 3.0))))))
double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * (y / z)) + (t / (z * (y * 3.0))));
}
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 / z)) + (t / (z * (y * 3.0d0))))
end function
public static double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * (y / z)) + (t / (z * (y * 3.0))));
}
def code(x, y, z, t): return x + ((-0.3333333333333333 * (y / z)) + (t / (z * (y * 3.0))))
function code(x, y, z, t) return Float64(x + Float64(Float64(-0.3333333333333333 * Float64(y / z)) + Float64(t / Float64(z * Float64(y * 3.0))))) end
function tmp = code(x, y, z, t) tmp = x + ((-0.3333333333333333 * (y / z)) + (t / (z * (y * 3.0)))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-0.3333333333333333 \cdot \frac{y}{z} + \frac{t}{z \cdot \left(y \cdot 3\right)}\right)
\end{array}
Initial program 96.8%
Simplified96.8%
fma-udef96.8%
Applied egg-rr96.8%
Final simplification96.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.8e+72)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.8e+42)
(+ x (/ t (* y (* z (- -3.0)))))
(+ x (/ 1.0 (* -3.0 (/ z y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+72) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.8e+42) {
tmp = x + (t / (y * (z * -(-3.0))));
} else {
tmp = x + (1.0 / (-3.0 * (z / 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 <= (-6.8d+72)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.8d+42) then
tmp = x + (t / (y * (z * -(-3.0d0))))
else
tmp = x + (1.0d0 / ((-3.0d0) * (z / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+72) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.8e+42) {
tmp = x + (t / (y * (z * -(-3.0))));
} else {
tmp = x + (1.0 / (-3.0 * (z / y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.8e+72: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.8e+42: tmp = x + (t / (y * (z * -(-3.0)))) else: tmp = x + (1.0 / (-3.0 * (z / y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e+72) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.8e+42) tmp = Float64(x + Float64(t / Float64(y * Float64(z * Float64(-(-3.0)))))); else tmp = Float64(x + Float64(1.0 / Float64(-3.0 * Float64(z / y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.8e+72) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.8e+42) tmp = x + (t / (y * (z * -(-3.0)))); else tmp = x + (1.0 / (-3.0 * (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e+72], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+42], N[(x + N[(t / N[(y * N[(z * (--3.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(-3.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+72}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{t}{y \cdot \left(z \cdot \left(--3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{-3 \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if y < -6.7999999999999997e72Initial program 97.4%
associate-+l-97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in t around 0 97.4%
if -6.7999999999999997e72 < y < 1.8e42Initial program 95.6%
Simplified93.9%
Taylor expanded in y around 0 86.4%
neg-mul-186.4%
distribute-neg-frac86.4%
Simplified86.4%
clear-num86.4%
frac-2neg86.4%
frac-times88.5%
*-un-lft-identity88.5%
add-sqr-sqrt43.6%
sqrt-unprod51.1%
sqr-neg51.1%
sqrt-unprod17.5%
add-sqr-sqrt32.3%
add-sqr-sqrt14.8%
sqrt-unprod49.8%
sqr-neg49.8%
sqrt-unprod44.6%
add-sqr-sqrt88.5%
div-inv88.5%
metadata-eval88.5%
Applied egg-rr88.5%
if 1.8e42 < y Initial program 99.7%
Simplified99.5%
Taylor expanded in y around inf 96.1%
div-inv96.1%
Applied egg-rr96.1%
un-div-inv96.1%
associate-/r/96.2%
clear-num96.1%
div-inv96.2%
metadata-eval96.2%
Applied egg-rr96.2%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.8e+72) (not (<= y 1.1e+42))) (- x (* (/ y z) 0.3333333333333333)) (+ x (* 0.3333333333333333 (/ t (* y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.8e+72) || !(y <= 1.1e+42)) {
tmp = x - ((y / z) * 0.3333333333333333);
} else {
tmp = x + (0.3333333333333333 * (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 ((y <= (-6.8d+72)) .or. (.not. (y <= 1.1d+42))) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.8e+72) || !(y <= 1.1e+42)) {
tmp = x - ((y / z) * 0.3333333333333333);
} else {
tmp = x + (0.3333333333333333 * (t / (y * z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.8e+72) or not (y <= 1.1e+42): tmp = x - ((y / z) * 0.3333333333333333) else: tmp = x + (0.3333333333333333 * (t / (y * z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.8e+72) || !(y <= 1.1e+42)) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); else tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.8e+72) || ~((y <= 1.1e+42))) tmp = x - ((y / z) * 0.3333333333333333); else tmp = x + (0.3333333333333333 * (t / (y * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.8e+72], N[Not[LessEqual[y, 1.1e+42]], $MachinePrecision]], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+72} \lor \neg \left(y \leq 1.1 \cdot 10^{+42}\right):\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\end{array}
\end{array}
if y < -6.7999999999999997e72 or 1.1000000000000001e42 < y Initial program 98.7%
associate-+l-98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in t around 0 96.7%
if -6.7999999999999997e72 < y < 1.1000000000000001e42Initial program 95.6%
Simplified93.9%
Taylor expanded in y around 0 88.4%
Final simplification91.5%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.45e+95)
(- x (* (/ y z) 0.3333333333333333))
(if (<= x 3.5e+64)
(* -0.3333333333333333 (/ (- y (/ t y)) z))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.45e+95) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (x <= 3.5e+64) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x + (y * (-0.3333333333333333 / 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 (x <= (-1.45d+95)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (x <= 3.5d+64) then
tmp = (-0.3333333333333333d0) * ((y - (t / y)) / z)
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.45e+95) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (x <= 3.5e+64) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.45e+95: tmp = x - ((y / z) * 0.3333333333333333) elif x <= 3.5e+64: tmp = -0.3333333333333333 * ((y - (t / y)) / z) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.45e+95) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (x <= 3.5e+64) tmp = Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z)); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.45e+95) tmp = x - ((y / z) * 0.3333333333333333); elseif (x <= 3.5e+64) tmp = -0.3333333333333333 * ((y - (t / y)) / z); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.45e+95], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e+64], N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+95}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+64}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if x < -1.45000000000000007e95Initial program 98.2%
associate-+l-98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in t around 0 77.4%
if -1.45000000000000007e95 < x < 3.4999999999999999e64Initial program 96.2%
Simplified96.1%
fma-udef96.1%
Applied egg-rr96.1%
Taylor expanded in z around 0 83.3%
associate-*r/83.3%
remove-double-neg83.3%
neg-mul-183.3%
times-frac83.3%
metadata-eval83.3%
distribute-lft-in83.3%
*-lft-identity83.3%
neg-mul-183.3%
times-frac83.3%
metadata-eval83.3%
neg-mul-183.3%
sub-neg83.3%
associate-*r/83.4%
Simplified83.4%
if 3.4999999999999999e64 < x Initial program 97.5%
Simplified97.4%
Taylor expanded in y around inf 85.2%
Final simplification82.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.8e+72)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.05e+43)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(+ x (/ 1.0 (* -3.0 (/ z y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+72) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.05e+43) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (1.0 / (-3.0 * (z / 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 <= (-6.8d+72)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.05d+43) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x + (1.0d0 / ((-3.0d0) * (z / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+72) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.05e+43) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (1.0 / (-3.0 * (z / y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.8e+72: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.05e+43: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x + (1.0 / (-3.0 * (z / y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e+72) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.05e+43) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x + Float64(1.0 / Float64(-3.0 * Float64(z / y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.8e+72) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.05e+43) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x + (1.0 / (-3.0 * (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e+72], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+43], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(-3.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+72}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+43}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{-3 \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if y < -6.7999999999999997e72Initial program 97.4%
associate-+l-97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in t around 0 97.4%
if -6.7999999999999997e72 < y < 1.05000000000000001e43Initial program 95.6%
Simplified93.9%
Taylor expanded in y around 0 88.4%
if 1.05000000000000001e43 < y Initial program 99.7%
Simplified99.5%
Taylor expanded in y around inf 96.1%
div-inv96.1%
Applied egg-rr96.1%
un-div-inv96.1%
associate-/r/96.2%
clear-num96.1%
div-inv96.2%
metadata-eval96.2%
Applied egg-rr96.2%
Final simplification91.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.8e+72)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 1.08e+43)
(+ x (/ t (* 3.0 (* y z))))
(+ x (/ 1.0 (* -3.0 (/ z y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+72) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.08e+43) {
tmp = x + (t / (3.0 * (y * z)));
} else {
tmp = x + (1.0 / (-3.0 * (z / 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 <= (-6.8d+72)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 1.08d+43) then
tmp = x + (t / (3.0d0 * (y * z)))
else
tmp = x + (1.0d0 / ((-3.0d0) * (z / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+72) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 1.08e+43) {
tmp = x + (t / (3.0 * (y * z)));
} else {
tmp = x + (1.0 / (-3.0 * (z / y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.8e+72: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 1.08e+43: tmp = x + (t / (3.0 * (y * z))) else: tmp = x + (1.0 / (-3.0 * (z / y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e+72) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 1.08e+43) tmp = Float64(x + Float64(t / Float64(3.0 * Float64(y * z)))); else tmp = Float64(x + Float64(1.0 / Float64(-3.0 * Float64(z / y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.8e+72) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 1.08e+43) tmp = x + (t / (3.0 * (y * z))); else tmp = x + (1.0 / (-3.0 * (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e+72], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.08e+43], N[(x + N[(t / N[(3.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(-3.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+72}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 1.08 \cdot 10^{+43}:\\
\;\;\;\;x + \frac{t}{3 \cdot \left(y \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{-3 \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if y < -6.7999999999999997e72Initial program 97.4%
associate-+l-97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in t around 0 97.4%
if -6.7999999999999997e72 < y < 1.08e43Initial program 95.6%
Simplified93.9%
Taylor expanded in y around 0 86.4%
neg-mul-186.4%
distribute-neg-frac86.4%
Simplified86.4%
clear-num86.4%
frac-2neg86.4%
frac-times88.5%
*-un-lft-identity88.5%
add-sqr-sqrt43.6%
sqrt-unprod51.1%
sqr-neg51.1%
sqrt-unprod17.5%
add-sqr-sqrt32.3%
add-sqr-sqrt14.8%
sqrt-unprod49.8%
sqr-neg49.8%
sqrt-unprod44.6%
add-sqr-sqrt88.5%
div-inv88.5%
metadata-eval88.5%
Applied egg-rr88.5%
Taylor expanded in z around 0 88.5%
if 1.08e43 < y Initial program 99.7%
Simplified99.5%
Taylor expanded in y around inf 96.1%
div-inv96.1%
Applied egg-rr96.1%
un-div-inv96.1%
associate-/r/96.2%
clear-num96.1%
div-inv96.2%
metadata-eval96.2%
Applied egg-rr96.2%
Final simplification91.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.4e+73)
(- x (* (/ y z) 0.3333333333333333))
(if (<= y 3.4e+42)
(+ x (/ t (* z (* y 3.0))))
(+ x (/ 1.0 (* -3.0 (/ z y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e+73) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 3.4e+42) {
tmp = x + (t / (z * (y * 3.0)));
} else {
tmp = x + (1.0 / (-3.0 * (z / 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 <= (-2.4d+73)) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else if (y <= 3.4d+42) then
tmp = x + (t / (z * (y * 3.0d0)))
else
tmp = x + (1.0d0 / ((-3.0d0) * (z / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e+73) {
tmp = x - ((y / z) * 0.3333333333333333);
} else if (y <= 3.4e+42) {
tmp = x + (t / (z * (y * 3.0)));
} else {
tmp = x + (1.0 / (-3.0 * (z / y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.4e+73: tmp = x - ((y / z) * 0.3333333333333333) elif y <= 3.4e+42: tmp = x + (t / (z * (y * 3.0))) else: tmp = x + (1.0 / (-3.0 * (z / y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.4e+73) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); elseif (y <= 3.4e+42) tmp = Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))); else tmp = Float64(x + Float64(1.0 / Float64(-3.0 * Float64(z / y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.4e+73) tmp = x - ((y / z) * 0.3333333333333333); elseif (y <= 3.4e+42) tmp = x + (t / (z * (y * 3.0))); else tmp = x + (1.0 / (-3.0 * (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.4e+73], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+42], N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(-3.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+73}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{-3 \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if y < -2.40000000000000002e73Initial program 97.4%
associate-+l-97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in t around 0 97.4%
if -2.40000000000000002e73 < y < 3.39999999999999975e42Initial program 95.6%
Simplified93.9%
Taylor expanded in y around 0 86.4%
neg-mul-186.4%
distribute-neg-frac86.4%
Simplified86.4%
clear-num86.4%
frac-2neg86.4%
frac-times88.5%
*-un-lft-identity88.5%
add-sqr-sqrt43.6%
sqrt-unprod51.1%
sqr-neg51.1%
sqrt-unprod17.5%
add-sqr-sqrt32.3%
add-sqr-sqrt14.8%
sqrt-unprod49.8%
sqr-neg49.8%
sqrt-unprod44.6%
add-sqr-sqrt88.5%
div-inv88.5%
metadata-eval88.5%
Applied egg-rr88.5%
Taylor expanded in z around 0 88.5%
*-commutative88.5%
*-commutative88.5%
associate-*r*88.5%
Simplified88.5%
if 3.39999999999999975e42 < y Initial program 99.7%
Simplified99.5%
Taylor expanded in y around inf 96.1%
div-inv96.1%
Applied egg-rr96.1%
un-div-inv96.1%
associate-/r/96.2%
clear-num96.1%
div-inv96.2%
metadata-eval96.2%
Applied egg-rr96.2%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7e-76) (not (<= y 8.4e-81))) (+ x (* y (/ -0.3333333333333333 z))) (* 0.3333333333333333 (/ t (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7e-76) || !(y <= 8.4e-81)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (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 ((y <= (-7d-76)) .or. (.not. (y <= 8.4d-81))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = 0.3333333333333333d0 * (t / (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7e-76) || !(y <= 8.4e-81)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (t / (y * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7e-76) or not (y <= 8.4e-81): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = 0.3333333333333333 * (t / (y * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7e-76) || !(y <= 8.4e-81)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7e-76) || ~((y <= 8.4e-81))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = 0.3333333333333333 * (t / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7e-76], N[Not[LessEqual[y, 8.4e-81]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-76} \lor \neg \left(y \leq 8.4 \cdot 10^{-81}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\end{array}
\end{array}
if y < -6.99999999999999995e-76 or 8.3999999999999997e-81 < y Initial program 99.1%
Simplified99.0%
Taylor expanded in y around inf 86.4%
if -6.99999999999999995e-76 < y < 8.3999999999999997e-81Initial program 93.3%
Simplified93.3%
fma-udef93.3%
Applied egg-rr93.3%
Taylor expanded in y around 0 69.3%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.22e-77) (not (<= y 6.3e-80))) (- x (* (/ y z) 0.3333333333333333)) (* 0.3333333333333333 (/ t (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.22e-77) || !(y <= 6.3e-80)) {
tmp = x - ((y / z) * 0.3333333333333333);
} else {
tmp = 0.3333333333333333 * (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 ((y <= (-1.22d-77)) .or. (.not. (y <= 6.3d-80))) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else
tmp = 0.3333333333333333d0 * (t / (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.22e-77) || !(y <= 6.3e-80)) {
tmp = x - ((y / z) * 0.3333333333333333);
} else {
tmp = 0.3333333333333333 * (t / (y * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.22e-77) or not (y <= 6.3e-80): tmp = x - ((y / z) * 0.3333333333333333) else: tmp = 0.3333333333333333 * (t / (y * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.22e-77) || !(y <= 6.3e-80)) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); else tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.22e-77) || ~((y <= 6.3e-80))) tmp = x - ((y / z) * 0.3333333333333333); else tmp = 0.3333333333333333 * (t / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.22e-77], N[Not[LessEqual[y, 6.3e-80]], $MachinePrecision]], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{-77} \lor \neg \left(y \leq 6.3 \cdot 10^{-80}\right):\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\end{array}
\end{array}
if y < -1.22000000000000001e-77 or 6.29999999999999966e-80 < y Initial program 99.1%
associate-+l-99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in t around 0 86.5%
if -1.22000000000000001e-77 < y < 6.29999999999999966e-80Initial program 93.3%
Simplified93.3%
fma-udef93.3%
Applied egg-rr93.3%
Taylor expanded in y around 0 69.3%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.5e-77) (not (<= y 9.8e-80))) (- x (* (/ y z) 0.3333333333333333)) (/ (* t 0.3333333333333333) (* y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.5e-77) || !(y <= 9.8e-80)) {
tmp = x - ((y / z) * 0.3333333333333333);
} else {
tmp = (t * 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 ((y <= (-2.5d-77)) .or. (.not. (y <= 9.8d-80))) then
tmp = x - ((y / z) * 0.3333333333333333d0)
else
tmp = (t * 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 ((y <= -2.5e-77) || !(y <= 9.8e-80)) {
tmp = x - ((y / z) * 0.3333333333333333);
} else {
tmp = (t * 0.3333333333333333) / (y * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.5e-77) or not (y <= 9.8e-80): tmp = x - ((y / z) * 0.3333333333333333) else: tmp = (t * 0.3333333333333333) / (y * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.5e-77) || !(y <= 9.8e-80)) tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); else tmp = Float64(Float64(t * 0.3333333333333333) / Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.5e-77) || ~((y <= 9.8e-80))) tmp = x - ((y / z) * 0.3333333333333333); else tmp = (t * 0.3333333333333333) / (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.5e-77], N[Not[LessEqual[y, 9.8e-80]], $MachinePrecision]], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], N[(N[(t * 0.3333333333333333), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-77} \lor \neg \left(y \leq 9.8 \cdot 10^{-80}\right):\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot 0.3333333333333333}{y \cdot z}\\
\end{array}
\end{array}
if y < -2.49999999999999982e-77 or 9.79999999999999981e-80 < y Initial program 99.1%
associate-+l-99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in t around 0 86.5%
if -2.49999999999999982e-77 < y < 9.79999999999999981e-80Initial program 93.3%
Simplified93.3%
fma-udef93.3%
Applied egg-rr93.3%
clear-num2.7%
un-div-inv2.7%
Applied egg-rr93.3%
Taylor expanded in y around 0 69.3%
associate-*r/69.3%
Simplified69.3%
Final simplification79.5%
(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.8%
Simplified96.0%
Final simplification96.0%
(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(Float64(-0.3333333333333333 * 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[(N[(-0.3333333333333333 * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}
\end{array}
Initial program 96.8%
Simplified96.0%
associate-*l/96.0%
Applied egg-rr96.0%
Final simplification96.0%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
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 + (((t / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t): return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Initial program 96.8%
associate-+l-96.8%
*-commutative96.8%
Simplified96.8%
sub-neg96.8%
associate-/r*96.1%
sub-div96.1%
Applied egg-rr96.1%
Final simplification96.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8.9e+179) (not (<= y 1150000000000.0))) (* -0.3333333333333333 (/ y z)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.9e+179) || !(y <= 1150000000000.0)) {
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 <= (-8.9d+179)) .or. (.not. (y <= 1150000000000.0d0))) 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 <= -8.9e+179) || !(y <= 1150000000000.0)) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8.9e+179) or not (y <= 1150000000000.0): tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8.9e+179) || !(y <= 1150000000000.0)) 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 <= -8.9e+179) || ~((y <= 1150000000000.0))) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8.9e+179], N[Not[LessEqual[y, 1150000000000.0]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.9 \cdot 10^{+179} \lor \neg \left(y \leq 1150000000000\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -8.90000000000000036e179 or 1.15e12 < y Initial program 99.8%
Simplified99.7%
fma-udef99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 75.9%
if -8.90000000000000036e179 < y < 1.15e12Initial program 95.3%
Simplified94.3%
Taylor expanded in x around inf 37.2%
Final simplification49.9%
(FPCore (x y z t) :precision binary64 (if (<= y -8.9e+179) (* -0.3333333333333333 (/ y z)) (if (<= y 110000000000.0) x (/ -0.3333333333333333 (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.9e+179) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 110000000000.0) {
tmp = x;
} else {
tmp = -0.3333333333333333 / (z / 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 <= (-8.9d+179)) then
tmp = (-0.3333333333333333d0) * (y / z)
else if (y <= 110000000000.0d0) then
tmp = x
else
tmp = (-0.3333333333333333d0) / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.9e+179) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 110000000000.0) {
tmp = x;
} else {
tmp = -0.3333333333333333 / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.9e+179: tmp = -0.3333333333333333 * (y / z) elif y <= 110000000000.0: tmp = x else: tmp = -0.3333333333333333 / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.9e+179) tmp = Float64(-0.3333333333333333 * Float64(y / z)); elseif (y <= 110000000000.0) tmp = x; else tmp = Float64(-0.3333333333333333 / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.9e+179) tmp = -0.3333333333333333 * (y / z); elseif (y <= 110000000000.0) tmp = x; else tmp = -0.3333333333333333 / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.9e+179], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 110000000000.0], x, N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.9 \cdot 10^{+179}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 110000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -8.90000000000000036e179Initial program 99.7%
Simplified99.7%
fma-udef99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 95.4%
if -8.90000000000000036e179 < y < 1.1e11Initial program 95.3%
Simplified94.3%
Taylor expanded in x around inf 37.2%
if 1.1e11 < y Initial program 99.8%
Simplified99.6%
fma-udef99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 68.5%
clear-num68.6%
un-div-inv68.6%
Applied egg-rr68.6%
Final simplification49.9%
(FPCore (x y z t) :precision binary64 (if (<= y -8.9e+179) (* -0.3333333333333333 (/ y z)) (if (<= y 70000000000.0) x (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.9e+179) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 70000000000.0) {
tmp = x;
} else {
tmp = 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 <= (-8.9d+179)) then
tmp = (-0.3333333333333333d0) * (y / z)
else if (y <= 70000000000.0d0) then
tmp = x
else
tmp = 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 <= -8.9e+179) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 70000000000.0) {
tmp = x;
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.9e+179: tmp = -0.3333333333333333 * (y / z) elif y <= 70000000000.0: tmp = x else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.9e+179) tmp = Float64(-0.3333333333333333 * Float64(y / z)); elseif (y <= 70000000000.0) tmp = x; else tmp = Float64(y / Float64(z * -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.9e+179) tmp = -0.3333333333333333 * (y / z); elseif (y <= 70000000000.0) tmp = x; else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.9e+179], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 70000000000.0], x, N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.9 \cdot 10^{+179}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 70000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -8.90000000000000036e179Initial program 99.7%
Simplified99.7%
fma-udef99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 95.4%
if -8.90000000000000036e179 < y < 7e10Initial program 95.3%
Simplified94.3%
Taylor expanded in x around inf 37.2%
if 7e10 < y Initial program 99.8%
Simplified99.6%
fma-udef99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 68.5%
associate-*r/68.5%
associate-*l/68.4%
*-commutative68.4%
clear-num68.4%
un-div-inv68.5%
div-inv68.6%
metadata-eval68.6%
Applied egg-rr68.6%
Final simplification49.9%
(FPCore (x y z t) :precision binary64 (if (<= y -8.9e+179) (/ (* y -0.3333333333333333) z) (if (<= y 510000000000.0) x (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.9e+179) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 510000000000.0) {
tmp = x;
} else {
tmp = 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 <= (-8.9d+179)) then
tmp = (y * (-0.3333333333333333d0)) / z
else if (y <= 510000000000.0d0) then
tmp = x
else
tmp = 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 <= -8.9e+179) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 510000000000.0) {
tmp = x;
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.9e+179: tmp = (y * -0.3333333333333333) / z elif y <= 510000000000.0: tmp = x else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.9e+179) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= 510000000000.0) tmp = x; else tmp = Float64(y / Float64(z * -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.9e+179) tmp = (y * -0.3333333333333333) / z; elseif (y <= 510000000000.0) tmp = x; else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.9e+179], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 510000000000.0], x, N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.9 \cdot 10^{+179}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 510000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -8.90000000000000036e179Initial program 99.7%
Simplified99.7%
fma-udef99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 95.4%
associate-*r/95.5%
Applied egg-rr95.5%
if -8.90000000000000036e179 < y < 5.1e11Initial program 95.3%
Simplified94.3%
Taylor expanded in x around inf 37.2%
if 5.1e11 < y Initial program 99.8%
Simplified99.6%
fma-udef99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 68.5%
associate-*r/68.5%
associate-*l/68.4%
*-commutative68.4%
clear-num68.4%
un-div-inv68.5%
div-inv68.6%
metadata-eval68.6%
Applied egg-rr68.6%
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 96.8%
Simplified96.0%
Taylor expanded in x around inf 31.6%
Final simplification31.6%
(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 2023306
(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))))