
(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 15 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 (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))))) (if (<= t_1 1e+288) t_1 (+ x (* 0.3333333333333333 (/ (- (/ t y) y) z))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
double tmp;
if (t_1 <= 1e+288) {
tmp = t_1;
} else {
tmp = x + (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) :: t_1
real(8) :: tmp
t_1 = (x - (y / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))
if (t_1 <= 1d+288) then
tmp = t_1
else
tmp = x + (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 t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
double tmp;
if (t_1 <= 1e+288) {
tmp = t_1;
} else {
tmp = x + (0.3333333333333333 * (((t / y) - y) / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))) tmp = 0 if t_1 <= 1e+288: tmp = t_1 else: tmp = x + (0.3333333333333333 * (((t / y) - y) / z)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) tmp = 0.0 if (t_1 <= 1e+288) tmp = t_1; else tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); tmp = 0.0; if (t_1 <= 1e+288) tmp = t_1; else tmp = x + (0.3333333333333333 * (((t / y) - y) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+288], t$95$1, N[(x + N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{if}\;t\_1 \leq 10^{+288}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) < 1e288Initial program 98.5%
if 1e288 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) Initial program 88.0%
+-commutative88.0%
associate-+r-88.0%
+-commutative88.0%
associate--l+88.0%
sub-neg88.0%
remove-double-neg88.0%
distribute-frac-neg88.0%
distribute-neg-in88.0%
remove-double-neg88.0%
sub-neg88.0%
neg-mul-188.0%
times-frac97.7%
distribute-frac-neg97.7%
neg-mul-197.7%
*-commutative97.7%
associate-/l*97.8%
*-commutative97.8%
Simplified99.9%
Taylor expanded in z around 0 100.0%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -5e-82) (+ (+ x (/ t (* 3.0 (* y z)))) (/ y (* z -3.0))) (+ x (/ (* 0.3333333333333333 (- (/ t y) y)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -5e-82) {
tmp = (x + (t / (3.0 * (y * z)))) + (y / (z * -3.0));
} else {
tmp = x + ((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) <= (-5d-82)) then
tmp = (x + (t / (3.0d0 * (y * z)))) + (y / (z * (-3.0d0)))
else
tmp = x + ((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) <= -5e-82) {
tmp = (x + (t / (3.0 * (y * z)))) + (y / (z * -3.0));
} else {
tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -5e-82: tmp = (x + (t / (3.0 * (y * z)))) + (y / (z * -3.0)) else: tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -5e-82) tmp = Float64(Float64(x + Float64(t / Float64(3.0 * Float64(y * z)))) + Float64(y / Float64(z * -3.0))); else tmp = Float64(x + Float64(Float64(0.3333333333333333 * 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) <= -5e-82) tmp = (x + (t / (3.0 * (y * z)))) + (y / (z * -3.0)); else tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -5e-82], N[(N[(x + N[(t / N[(3.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -5 \cdot 10^{-82}:\\
\;\;\;\;\left(x + \frac{t}{3 \cdot \left(y \cdot z\right)}\right) + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -4.9999999999999998e-82Initial program 98.7%
+-commutative98.7%
associate-+r-98.7%
sub-neg98.7%
associate-*l*98.7%
*-commutative98.7%
distribute-frac-neg298.7%
distribute-rgt-neg-in98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in z around 0 98.7%
if -4.9999999999999998e-82 < (*.f64 z #s(literal 3 binary64)) Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
+-commutative95.6%
associate--l+95.6%
sub-neg95.6%
remove-double-neg95.6%
distribute-frac-neg95.6%
distribute-neg-in95.6%
remove-double-neg95.6%
sub-neg95.6%
neg-mul-195.6%
times-frac98.2%
distribute-frac-neg98.2%
neg-mul-198.2%
*-commutative98.2%
associate-/l*98.1%
*-commutative98.1%
Simplified98.6%
associate-*l/98.7%
Applied egg-rr98.7%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.3e-6) (not (<= z 0.058))) (+ x (/ y (* z -3.0))) (* 0.3333333333333333 (/ (- (/ t y) y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.3e-6) || !(z <= 0.058)) {
tmp = x + (y / (z * -3.0));
} 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 <= (-1.3d-6)) .or. (.not. (z <= 0.058d0))) then
tmp = x + (y / (z * (-3.0d0)))
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 <= -1.3e-6) || !(z <= 0.058)) {
tmp = x + (y / (z * -3.0));
} else {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.3e-6) or not (z <= 0.058): tmp = x + (y / (z * -3.0)) else: tmp = 0.3333333333333333 * (((t / y) - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.3e-6) || !(z <= 0.058)) tmp = Float64(x + Float64(y / Float64(z * -3.0))); 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 <= -1.3e-6) || ~((z <= 0.058))) tmp = x + (y / (z * -3.0)); else tmp = 0.3333333333333333 * (((t / y) - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.3e-6], N[Not[LessEqual[z, 0.058]], $MachinePrecision]], N[(x + N[(y / N[(z * -3.0), $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 \leq -1.3 \cdot 10^{-6} \lor \neg \left(z \leq 0.058\right):\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\end{array}
\end{array}
if z < -1.30000000000000005e-6 or 0.0580000000000000029 < z Initial program 99.2%
+-commutative99.2%
associate-+r-99.2%
+-commutative99.2%
associate--l+99.2%
sub-neg99.2%
remove-double-neg99.2%
distribute-frac-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
sub-neg99.2%
neg-mul-199.2%
times-frac93.5%
distribute-frac-neg93.5%
neg-mul-193.5%
*-commutative93.5%
associate-/l*93.5%
*-commutative93.5%
Simplified93.4%
Taylor expanded in t around 0 78.9%
metadata-eval78.9%
cancel-sign-sub-inv78.9%
associate-*r/78.9%
Simplified78.9%
associate-*l/78.9%
un-div-inv78.8%
unsub-neg78.8%
distribute-rgt-neg-out78.8%
+-commutative78.8%
*-commutative78.8%
associate-*r*78.9%
distribute-lft-neg-in78.9%
distribute-rgt-neg-in78.9%
metadata-eval78.9%
associate-*r*78.8%
div-inv78.9%
clear-num78.9%
un-div-inv78.9%
div-inv79.0%
metadata-eval79.0%
Applied egg-rr79.0%
if -1.30000000000000005e-6 < z < 0.0580000000000000029Initial program 93.7%
+-commutative93.7%
associate-+r-93.7%
+-commutative93.7%
associate--l+93.7%
sub-neg93.7%
remove-double-neg93.7%
distribute-frac-neg93.7%
distribute-neg-in93.7%
remove-double-neg93.7%
sub-neg93.7%
neg-mul-193.7%
times-frac98.9%
distribute-frac-neg98.9%
neg-mul-198.9%
*-commutative98.9%
associate-/l*98.9%
*-commutative98.9%
Simplified99.7%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 91.1%
Final simplification84.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -80000000.0)
(- x (/ (* y 0.3333333333333333) z))
(if (<= y 7.2e+44)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -80000000.0) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 7.2e+44) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-80000000.0d0)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if (y <= 7.2d+44) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -80000000.0) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 7.2e+44) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -80000000.0: tmp = x - ((y * 0.3333333333333333) / z) elif y <= 7.2e+44: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -80000000.0) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (y <= 7.2e+44) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -80000000.0) tmp = x - ((y * 0.3333333333333333) / z); elseif (y <= 7.2e+44) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -80000000.0], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+44], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -80000000:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+44}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -8e7Initial program 98.3%
+-commutative98.3%
associate-+r-98.3%
+-commutative98.3%
associate--l+98.3%
sub-neg98.3%
remove-double-neg98.3%
distribute-frac-neg98.3%
distribute-neg-in98.3%
remove-double-neg98.3%
sub-neg98.3%
neg-mul-198.3%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
*-commutative99.7%
Simplified99.6%
Taylor expanded in t around 0 96.4%
metadata-eval96.4%
cancel-sign-sub-inv96.4%
associate-*r/96.4%
Simplified96.4%
if -8e7 < y < 7.2e44Initial program 95.2%
+-commutative95.2%
associate-+r-95.2%
+-commutative95.2%
associate--l+95.2%
sub-neg95.2%
remove-double-neg95.2%
distribute-frac-neg95.2%
distribute-neg-in95.2%
remove-double-neg95.2%
sub-neg95.2%
neg-mul-195.2%
times-frac93.8%
distribute-frac-neg93.8%
neg-mul-193.8%
*-commutative93.8%
associate-/l*93.8%
*-commutative93.8%
Simplified93.7%
Taylor expanded in t around inf 89.7%
if 7.2e44 < y Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
+-commutative98.0%
associate--l+98.0%
sub-neg98.0%
remove-double-neg98.0%
distribute-frac-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
sub-neg98.0%
neg-mul-198.0%
times-frac98.0%
distribute-frac-neg98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*97.9%
*-commutative97.9%
Simplified99.8%
Taylor expanded in t around 0 94.7%
metadata-eval94.7%
cancel-sign-sub-inv94.7%
associate-*r/94.6%
Simplified94.6%
associate-*l/94.7%
un-div-inv94.7%
unsub-neg94.7%
distribute-rgt-neg-out94.7%
+-commutative94.7%
*-commutative94.7%
associate-*r*94.5%
distribute-lft-neg-in94.5%
distribute-rgt-neg-in94.5%
metadata-eval94.5%
associate-*r*94.7%
div-inv94.7%
clear-num94.5%
un-div-inv94.5%
div-inv94.8%
metadata-eval94.8%
Applied egg-rr94.8%
Final simplification92.4%
(FPCore (x y z t) :precision binary64 (if (<= y -720.0) (- x (/ (* y 0.3333333333333333) z)) (if (<= y 2e+46) (+ x (/ t (* y (* z 3.0)))) (+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -720.0) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 2e+46) {
tmp = x + (t / (y * (z * 3.0)));
} 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 <= (-720.0d0)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if (y <= 2d+46) then
tmp = x + (t / (y * (z * 3.0d0)))
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 <= -720.0) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 2e+46) {
tmp = x + (t / (y * (z * 3.0)));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -720.0: tmp = x - ((y * 0.3333333333333333) / z) elif y <= 2e+46: tmp = x + (t / (y * (z * 3.0))) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -720.0) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (y <= 2e+46) tmp = Float64(x + Float64(t / Float64(y * Float64(z * 3.0)))); 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 <= -720.0) tmp = x - ((y * 0.3333333333333333) / z); elseif (y <= 2e+46) tmp = x + (t / (y * (z * 3.0))); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -720.0], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+46], N[(x + N[(t / N[(y * N[(z * 3.0), $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 -720:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+46}:\\
\;\;\;\;x + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -720Initial program 98.3%
+-commutative98.3%
associate-+r-98.3%
+-commutative98.3%
associate--l+98.3%
sub-neg98.3%
remove-double-neg98.3%
distribute-frac-neg98.3%
distribute-neg-in98.3%
remove-double-neg98.3%
sub-neg98.3%
neg-mul-198.3%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
*-commutative99.7%
Simplified99.6%
Taylor expanded in t around 0 96.4%
metadata-eval96.4%
cancel-sign-sub-inv96.4%
associate-*r/96.4%
Simplified96.4%
if -720 < y < 2e46Initial program 95.2%
+-commutative95.2%
associate-+r-95.2%
+-commutative95.2%
associate--l+95.2%
sub-neg95.2%
remove-double-neg95.2%
distribute-frac-neg95.2%
distribute-neg-in95.2%
remove-double-neg95.2%
sub-neg95.2%
neg-mul-195.2%
times-frac93.8%
distribute-frac-neg93.8%
neg-mul-193.8%
*-commutative93.8%
associate-/l*93.8%
*-commutative93.8%
Simplified93.7%
Taylor expanded in t around inf 89.7%
associate-*r/89.7%
*-commutative89.7%
times-frac87.2%
Simplified87.2%
clear-num87.2%
frac-times89.8%
*-un-lft-identity89.8%
div-inv89.7%
metadata-eval89.7%
Applied egg-rr89.7%
if 2e46 < y Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
+-commutative98.0%
associate--l+98.0%
sub-neg98.0%
remove-double-neg98.0%
distribute-frac-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
sub-neg98.0%
neg-mul-198.0%
times-frac98.0%
distribute-frac-neg98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*97.9%
*-commutative97.9%
Simplified99.8%
Taylor expanded in t around 0 94.7%
metadata-eval94.7%
cancel-sign-sub-inv94.7%
associate-*r/94.6%
Simplified94.6%
associate-*l/94.7%
un-div-inv94.7%
unsub-neg94.7%
distribute-rgt-neg-out94.7%
+-commutative94.7%
*-commutative94.7%
associate-*r*94.5%
distribute-lft-neg-in94.5%
distribute-rgt-neg-in94.5%
metadata-eval94.5%
associate-*r*94.7%
div-inv94.7%
clear-num94.5%
un-div-inv94.5%
div-inv94.8%
metadata-eval94.8%
Applied egg-rr94.8%
Final simplification92.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.5e-45) (not (<= y 5.3e-129))) (+ x (/ y (* z -3.0))) (* 0.3333333333333333 (/ t (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.5e-45) || !(y <= 5.3e-129)) {
tmp = x + (y / (z * -3.0));
} 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 <= (-7.5d-45)) .or. (.not. (y <= 5.3d-129))) then
tmp = x + (y / (z * (-3.0d0)))
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 <= -7.5e-45) || !(y <= 5.3e-129)) {
tmp = x + (y / (z * -3.0));
} else {
tmp = 0.3333333333333333 * (t / (y * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.5e-45) or not (y <= 5.3e-129): tmp = x + (y / (z * -3.0)) else: tmp = 0.3333333333333333 * (t / (y * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.5e-45) || !(y <= 5.3e-129)) tmp = Float64(x + Float64(y / Float64(z * -3.0))); 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 <= -7.5e-45) || ~((y <= 5.3e-129))) tmp = x + (y / (z * -3.0)); else tmp = 0.3333333333333333 * (t / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.5e-45], N[Not[LessEqual[y, 5.3e-129]], $MachinePrecision]], N[(x + N[(y / N[(z * -3.0), $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.5 \cdot 10^{-45} \lor \neg \left(y \leq 5.3 \cdot 10^{-129}\right):\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\end{array}
\end{array}
if y < -7.5000000000000006e-45 or 5.29999999999999974e-129 < y Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
+-commutative98.2%
associate--l+98.2%
sub-neg98.2%
remove-double-neg98.2%
distribute-frac-neg98.2%
distribute-neg-in98.2%
remove-double-neg98.2%
sub-neg98.2%
neg-mul-198.2%
times-frac98.6%
distribute-frac-neg98.6%
neg-mul-198.6%
*-commutative98.6%
associate-/l*98.6%
*-commutative98.6%
Simplified99.1%
Taylor expanded in t around 0 83.5%
metadata-eval83.5%
cancel-sign-sub-inv83.5%
associate-*r/83.5%
Simplified83.5%
associate-*l/83.5%
un-div-inv83.5%
unsub-neg83.5%
distribute-rgt-neg-out83.5%
+-commutative83.5%
*-commutative83.5%
associate-*r*83.5%
distribute-lft-neg-in83.5%
distribute-rgt-neg-in83.5%
metadata-eval83.5%
associate-*r*83.5%
div-inv83.5%
clear-num83.5%
un-div-inv83.5%
div-inv83.6%
metadata-eval83.6%
Applied egg-rr83.6%
if -7.5000000000000006e-45 < y < 5.29999999999999974e-129Initial program 93.3%
+-commutative93.3%
associate-+r-93.3%
+-commutative93.3%
associate--l+93.3%
sub-neg93.3%
remove-double-neg93.3%
distribute-frac-neg93.3%
distribute-neg-in93.3%
remove-double-neg93.3%
sub-neg93.3%
neg-mul-193.3%
times-frac91.1%
distribute-frac-neg91.1%
neg-mul-191.1%
*-commutative91.1%
associate-/l*91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in z around 0 91.1%
Taylor expanded in x around 0 60.3%
Taylor expanded in t around inf 62.7%
Final simplification76.6%
(FPCore (x y z t) :precision binary64 (if (<= y -550000000000.0) (/ (* y -0.3333333333333333) z) (if (<= y 1.18e+51) (* 0.3333333333333333 (/ t (* y z))) (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -550000000000.0) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 1.18e+51) {
tmp = 0.3333333333333333 * (t / (y * z));
} 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 <= (-550000000000.0d0)) then
tmp = (y * (-0.3333333333333333d0)) / z
else if (y <= 1.18d+51) then
tmp = 0.3333333333333333d0 * (t / (y * z))
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 <= -550000000000.0) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 1.18e+51) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -550000000000.0: tmp = (y * -0.3333333333333333) / z elif y <= 1.18e+51: tmp = 0.3333333333333333 * (t / (y * z)) else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -550000000000.0) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= 1.18e+51) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); 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 <= -550000000000.0) tmp = (y * -0.3333333333333333) / z; elseif (y <= 1.18e+51) tmp = 0.3333333333333333 * (t / (y * z)); else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -550000000000.0], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 1.18e+51], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -550000000000:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 1.18 \cdot 10^{+51}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -5.5e11Initial program 98.3%
+-commutative98.3%
associate-+r-98.3%
sub-neg98.3%
associate-*l*98.3%
*-commutative98.3%
distribute-frac-neg298.3%
distribute-rgt-neg-in98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in z around 0 98.3%
Taylor expanded in y around inf 73.8%
associate-*r/73.9%
*-commutative73.9%
Simplified73.9%
if -5.5e11 < y < 1.18e51Initial program 95.2%
+-commutative95.2%
associate-+r-95.2%
+-commutative95.2%
associate--l+95.2%
sub-neg95.2%
remove-double-neg95.2%
distribute-frac-neg95.2%
distribute-neg-in95.2%
remove-double-neg95.2%
sub-neg95.2%
neg-mul-195.2%
times-frac93.9%
distribute-frac-neg93.9%
neg-mul-193.9%
*-commutative93.9%
associate-/l*93.9%
*-commutative93.9%
Simplified93.8%
Taylor expanded in z around 0 93.9%
Taylor expanded in x around 0 58.4%
Taylor expanded in t around inf 54.8%
if 1.18e51 < y Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
+-commutative98.0%
associate--l+98.0%
sub-neg98.0%
remove-double-neg98.0%
distribute-frac-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
sub-neg98.0%
neg-mul-198.0%
times-frac98.0%
distribute-frac-neg98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*97.8%
*-commutative97.8%
Simplified99.8%
Taylor expanded in y around inf 94.5%
Taylor expanded in x around 0 72.2%
clear-num72.0%
un-div-inv72.0%
div-inv72.3%
metadata-eval72.3%
Applied egg-rr72.3%
Final simplification63.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -6e-44)
(- x (/ (* y 0.3333333333333333) z))
(if (<= y 8.8e-130)
(* 0.3333333333333333 (/ t (* y z)))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e-44) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 8.8e-130) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6d-44)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if (y <= 8.8d-130) then
tmp = 0.3333333333333333d0 * (t / (y * z))
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e-44) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 8.8e-130) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6e-44: tmp = x - ((y * 0.3333333333333333) / z) elif y <= 8.8e-130: tmp = 0.3333333333333333 * (t / (y * z)) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6e-44) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (y <= 8.8e-130) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6e-44) tmp = x - ((y * 0.3333333333333333) / z); elseif (y <= 8.8e-130) tmp = 0.3333333333333333 * (t / (y * z)); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6e-44], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.8e-130], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-44}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{-130}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -6.0000000000000005e-44Initial program 98.6%
+-commutative98.6%
associate-+r-98.6%
+-commutative98.6%
associate--l+98.6%
sub-neg98.6%
remove-double-neg98.6%
distribute-frac-neg98.6%
distribute-neg-in98.6%
remove-double-neg98.6%
sub-neg98.6%
neg-mul-198.6%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
*-commutative99.7%
Simplified99.6%
Taylor expanded in t around 0 90.2%
metadata-eval90.2%
cancel-sign-sub-inv90.2%
associate-*r/90.3%
Simplified90.3%
if -6.0000000000000005e-44 < y < 8.7999999999999995e-130Initial program 93.3%
+-commutative93.3%
associate-+r-93.3%
+-commutative93.3%
associate--l+93.3%
sub-neg93.3%
remove-double-neg93.3%
distribute-frac-neg93.3%
distribute-neg-in93.3%
remove-double-neg93.3%
sub-neg93.3%
neg-mul-193.3%
times-frac91.1%
distribute-frac-neg91.1%
neg-mul-191.1%
*-commutative91.1%
associate-/l*91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in z around 0 91.1%
Taylor expanded in x around 0 60.3%
Taylor expanded in t around inf 62.7%
if 8.7999999999999995e-130 < y Initial program 97.9%
+-commutative97.9%
associate-+r-97.9%
+-commutative97.9%
associate--l+97.9%
sub-neg97.9%
remove-double-neg97.9%
distribute-frac-neg97.9%
distribute-neg-in97.9%
remove-double-neg97.9%
sub-neg97.9%
neg-mul-197.9%
times-frac97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.8%
*-commutative97.8%
Simplified98.8%
Taylor expanded in t around 0 78.5%
metadata-eval78.5%
cancel-sign-sub-inv78.5%
associate-*r/78.4%
Simplified78.4%
associate-*l/78.4%
un-div-inv78.5%
unsub-neg78.5%
distribute-rgt-neg-out78.5%
+-commutative78.5%
*-commutative78.5%
associate-*r*78.4%
distribute-lft-neg-in78.4%
distribute-rgt-neg-in78.4%
metadata-eval78.4%
associate-*r*78.5%
div-inv78.4%
clear-num78.3%
un-div-inv78.3%
div-inv78.5%
metadata-eval78.5%
Applied egg-rr78.5%
Final simplification76.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.08e-44)
(- x (/ (* y 0.3333333333333333) z))
(if (<= y 4.5e-129)
(/ (* 0.3333333333333333 (/ t z)) y)
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.08e-44) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 4.5e-129) {
tmp = (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 <= (-1.08d-44)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if (y <= 4.5d-129) then
tmp = (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 <= -1.08e-44) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 4.5e-129) {
tmp = (0.3333333333333333 * (t / z)) / y;
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.08e-44: tmp = x - ((y * 0.3333333333333333) / z) elif y <= 4.5e-129: tmp = (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 <= -1.08e-44) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (y <= 4.5e-129) tmp = Float64(Float64(0.3333333333333333 * 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 <= -1.08e-44) tmp = x - ((y * 0.3333333333333333) / z); elseif (y <= 4.5e-129) tmp = (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, -1.08e-44], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-129], N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{-44}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-129}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -1.07999999999999994e-44Initial program 98.6%
+-commutative98.6%
associate-+r-98.6%
+-commutative98.6%
associate--l+98.6%
sub-neg98.6%
remove-double-neg98.6%
distribute-frac-neg98.6%
distribute-neg-in98.6%
remove-double-neg98.6%
sub-neg98.6%
neg-mul-198.6%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
*-commutative99.7%
Simplified99.6%
Taylor expanded in t around 0 90.2%
metadata-eval90.2%
cancel-sign-sub-inv90.2%
associate-*r/90.3%
Simplified90.3%
if -1.07999999999999994e-44 < y < 4.50000000000000031e-129Initial program 93.3%
+-commutative93.3%
associate-+r-93.3%
+-commutative93.3%
associate--l+93.3%
sub-neg93.3%
remove-double-neg93.3%
distribute-frac-neg93.3%
distribute-neg-in93.3%
remove-double-neg93.3%
sub-neg93.3%
neg-mul-193.3%
times-frac91.1%
distribute-frac-neg91.1%
neg-mul-191.1%
*-commutative91.1%
associate-/l*91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in y around 0 95.7%
Taylor expanded in t around inf 66.9%
if 4.50000000000000031e-129 < y Initial program 97.9%
+-commutative97.9%
associate-+r-97.9%
+-commutative97.9%
associate--l+97.9%
sub-neg97.9%
remove-double-neg97.9%
distribute-frac-neg97.9%
distribute-neg-in97.9%
remove-double-neg97.9%
sub-neg97.9%
neg-mul-197.9%
times-frac97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.8%
*-commutative97.8%
Simplified98.8%
Taylor expanded in t around 0 78.5%
metadata-eval78.5%
cancel-sign-sub-inv78.5%
associate-*r/78.4%
Simplified78.4%
associate-*l/78.4%
un-div-inv78.5%
unsub-neg78.5%
distribute-rgt-neg-out78.5%
+-commutative78.5%
*-commutative78.5%
associate-*r*78.4%
distribute-lft-neg-in78.4%
distribute-rgt-neg-in78.4%
metadata-eval78.4%
associate-*r*78.5%
div-inv78.4%
clear-num78.3%
un-div-inv78.3%
div-inv78.5%
metadata-eval78.5%
Applied egg-rr78.5%
Final simplification78.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.1e-45)
(- x (/ (* y 0.3333333333333333) z))
(if (<= y 5.8e-129)
(/ (/ (* t 0.3333333333333333) z) y)
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.1e-45) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 5.8e-129) {
tmp = ((t * 0.3333333333333333) / 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 <= (-5.1d-45)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if (y <= 5.8d-129) then
tmp = ((t * 0.3333333333333333d0) / 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 <= -5.1e-45) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if (y <= 5.8e-129) {
tmp = ((t * 0.3333333333333333) / z) / y;
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.1e-45: tmp = x - ((y * 0.3333333333333333) / z) elif y <= 5.8e-129: tmp = ((t * 0.3333333333333333) / z) / y else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.1e-45) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (y <= 5.8e-129) tmp = Float64(Float64(Float64(t * 0.3333333333333333) / 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 <= -5.1e-45) tmp = x - ((y * 0.3333333333333333) / z); elseif (y <= 5.8e-129) tmp = ((t * 0.3333333333333333) / z) / y; else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.1e-45], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-129], N[(N[(N[(t * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{-45}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-129}:\\
\;\;\;\;\frac{\frac{t \cdot 0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -5.0999999999999997e-45Initial program 98.6%
+-commutative98.6%
associate-+r-98.6%
+-commutative98.6%
associate--l+98.6%
sub-neg98.6%
remove-double-neg98.6%
distribute-frac-neg98.6%
distribute-neg-in98.6%
remove-double-neg98.6%
sub-neg98.6%
neg-mul-198.6%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
*-commutative99.7%
Simplified99.6%
Taylor expanded in t around 0 90.2%
metadata-eval90.2%
cancel-sign-sub-inv90.2%
associate-*r/90.3%
Simplified90.3%
if -5.0999999999999997e-45 < y < 5.80000000000000034e-129Initial program 93.3%
+-commutative93.3%
associate-+r-93.3%
+-commutative93.3%
associate--l+93.3%
sub-neg93.3%
remove-double-neg93.3%
distribute-frac-neg93.3%
distribute-neg-in93.3%
remove-double-neg93.3%
sub-neg93.3%
neg-mul-193.3%
times-frac91.1%
distribute-frac-neg91.1%
neg-mul-191.1%
*-commutative91.1%
associate-/l*91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in y around 0 95.7%
Taylor expanded in t around inf 66.9%
associate-*r/67.0%
Simplified67.0%
if 5.80000000000000034e-129 < y Initial program 97.9%
+-commutative97.9%
associate-+r-97.9%
+-commutative97.9%
associate--l+97.9%
sub-neg97.9%
remove-double-neg97.9%
distribute-frac-neg97.9%
distribute-neg-in97.9%
remove-double-neg97.9%
sub-neg97.9%
neg-mul-197.9%
times-frac97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.8%
*-commutative97.8%
Simplified98.8%
Taylor expanded in t around 0 78.5%
metadata-eval78.5%
cancel-sign-sub-inv78.5%
associate-*r/78.4%
Simplified78.4%
associate-*l/78.4%
un-div-inv78.5%
unsub-neg78.5%
distribute-rgt-neg-out78.5%
+-commutative78.5%
*-commutative78.5%
associate-*r*78.4%
distribute-lft-neg-in78.4%
distribute-rgt-neg-in78.4%
metadata-eval78.4%
associate-*r*78.5%
div-inv78.4%
clear-num78.3%
un-div-inv78.3%
div-inv78.5%
metadata-eval78.5%
Applied egg-rr78.5%
Final simplification78.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.1e-9) (not (<= y 2.35e+52))) (* -0.3333333333333333 (/ y z)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.1e-9) || !(y <= 2.35e+52)) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.1d-9)) .or. (.not. (y <= 2.35d+52))) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.1e-9) || !(y <= 2.35e+52)) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.1e-9) or not (y <= 2.35e+52): tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.1e-9) || !(y <= 2.35e+52)) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.1e-9) || ~((y <= 2.35e+52))) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.1e-9], N[Not[LessEqual[y, 2.35e+52]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-9} \lor \neg \left(y \leq 2.35 \cdot 10^{+52}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.0999999999999999e-9 or 2.35e52 < y Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
sub-neg98.2%
associate-*l*98.2%
*-commutative98.2%
distribute-frac-neg298.2%
distribute-rgt-neg-in98.2%
metadata-eval98.2%
Simplified98.2%
Taylor expanded in z around 0 98.2%
Taylor expanded in y around inf 71.5%
if -1.0999999999999999e-9 < y < 2.35e52Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac93.7%
distribute-frac-neg93.7%
neg-mul-193.7%
*-commutative93.7%
associate-/l*93.7%
*-commutative93.7%
Simplified93.6%
Taylor expanded in x around inf 38.8%
Final simplification53.9%
(FPCore (x y z t) :precision binary64 (if (<= y -1.1e-9) (* -0.3333333333333333 (/ y z)) (if (<= y 7e+52) x (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e-9) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 7e+52) {
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 <= (-1.1d-9)) then
tmp = (-0.3333333333333333d0) * (y / z)
else if (y <= 7d+52) 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 <= -1.1e-9) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 7e+52) {
tmp = x;
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.1e-9: tmp = -0.3333333333333333 * (y / z) elif y <= 7e+52: tmp = x else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e-9) tmp = Float64(-0.3333333333333333 * Float64(y / z)); elseif (y <= 7e+52) 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 <= -1.1e-9) tmp = -0.3333333333333333 * (y / z); elseif (y <= 7e+52) tmp = x; else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e-9], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+52], x, N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-9}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+52}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -1.0999999999999999e-9Initial program 98.4%
+-commutative98.4%
associate-+r-98.4%
sub-neg98.4%
associate-*l*98.4%
*-commutative98.4%
distribute-frac-neg298.4%
distribute-rgt-neg-in98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in z around 0 98.4%
Taylor expanded in y around inf 71.0%
if -1.0999999999999999e-9 < y < 7e52Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac93.7%
distribute-frac-neg93.7%
neg-mul-193.7%
*-commutative93.7%
associate-/l*93.7%
*-commutative93.7%
Simplified93.6%
Taylor expanded in x around inf 38.8%
if 7e52 < y Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
+-commutative98.0%
associate--l+98.0%
sub-neg98.0%
remove-double-neg98.0%
distribute-frac-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
sub-neg98.0%
neg-mul-198.0%
times-frac98.0%
distribute-frac-neg98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*97.8%
*-commutative97.8%
Simplified99.8%
Taylor expanded in y around inf 94.5%
Taylor expanded in x around 0 72.2%
clear-num72.0%
un-div-inv72.0%
div-inv72.3%
metadata-eval72.3%
Applied egg-rr72.3%
Final simplification53.9%
(FPCore (x y z t) :precision binary64 (if (<= y -2.8e-10) (/ (* y -0.3333333333333333) z) (if (<= y 5.4e+53) x (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e-10) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 5.4e+53) {
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 <= (-2.8d-10)) then
tmp = (y * (-0.3333333333333333d0)) / z
else if (y <= 5.4d+53) 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 <= -2.8e-10) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 5.4e+53) {
tmp = x;
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.8e-10: tmp = (y * -0.3333333333333333) / z elif y <= 5.4e+53: tmp = x else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.8e-10) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= 5.4e+53) 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 <= -2.8e-10) tmp = (y * -0.3333333333333333) / z; elseif (y <= 5.4e+53) tmp = x; else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e-10], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 5.4e+53], x, N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-10}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -2.80000000000000015e-10Initial program 98.4%
+-commutative98.4%
associate-+r-98.4%
sub-neg98.4%
associate-*l*98.4%
*-commutative98.4%
distribute-frac-neg298.4%
distribute-rgt-neg-in98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in z around 0 98.4%
Taylor expanded in y around inf 71.0%
associate-*r/71.0%
*-commutative71.0%
Simplified71.0%
if -2.80000000000000015e-10 < y < 5.40000000000000039e53Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
+-commutative95.1%
associate--l+95.1%
sub-neg95.1%
remove-double-neg95.1%
distribute-frac-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
sub-neg95.1%
neg-mul-195.1%
times-frac93.7%
distribute-frac-neg93.7%
neg-mul-193.7%
*-commutative93.7%
associate-/l*93.7%
*-commutative93.7%
Simplified93.6%
Taylor expanded in x around inf 38.8%
if 5.40000000000000039e53 < y Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
+-commutative98.0%
associate--l+98.0%
sub-neg98.0%
remove-double-neg98.0%
distribute-frac-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
sub-neg98.0%
neg-mul-198.0%
times-frac98.0%
distribute-frac-neg98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*97.8%
*-commutative97.8%
Simplified99.8%
Taylor expanded in y around inf 94.5%
Taylor expanded in x around 0 72.2%
clear-num72.0%
un-div-inv72.0%
div-inv72.3%
metadata-eval72.3%
Applied egg-rr72.3%
Final simplification53.9%
(FPCore (x y z t) :precision binary64 (+ x (* 0.3333333333333333 (/ (- (/ t y) y) z))))
double code(double x, double y, double z, double t) {
return x + (0.3333333333333333 * (((t / y) - 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 * (((t / y) - y) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (0.3333333333333333 * (((t / y) - y) / z));
}
def code(x, y, z, t): return x + (0.3333333333333333 * (((t / y) - y) / z))
function code(x, y, z, t) return Float64(x + Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z))) end
function tmp = code(x, y, z, t) tmp = x + (0.3333333333333333 * (((t / y) - y) / z)); end
code[x_, y_, z_, t_] := N[(x + N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}
\end{array}
Initial program 96.5%
+-commutative96.5%
associate-+r-96.5%
+-commutative96.5%
associate--l+96.5%
sub-neg96.5%
remove-double-neg96.5%
distribute-frac-neg96.5%
distribute-neg-in96.5%
remove-double-neg96.5%
sub-neg96.5%
neg-mul-196.5%
times-frac96.1%
distribute-frac-neg96.1%
neg-mul-196.1%
*-commutative96.1%
associate-/l*96.1%
*-commutative96.1%
Simplified96.4%
Taylor expanded in z around 0 96.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.5%
+-commutative96.5%
associate-+r-96.5%
+-commutative96.5%
associate--l+96.5%
sub-neg96.5%
remove-double-neg96.5%
distribute-frac-neg96.5%
distribute-neg-in96.5%
remove-double-neg96.5%
sub-neg96.5%
neg-mul-196.5%
times-frac96.1%
distribute-frac-neg96.1%
neg-mul-196.1%
*-commutative96.1%
associate-/l*96.1%
*-commutative96.1%
Simplified96.4%
Taylor expanded in x around inf 31.7%
Final simplification31.7%
(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 2024075
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))