
(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 (if (or (<= y -3.1e-27) (not (<= y 1.25e-107))) (+ x (/ (- y (/ t y)) (* z -3.0))) (+ x (/ (/ t (* z 3.0)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.1e-27) || !(y <= 1.25e-107)) {
tmp = x + ((y - (t / y)) / (z * -3.0));
} else {
tmp = x + ((t / (z * 3.0)) / 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 <= (-3.1d-27)) .or. (.not. (y <= 1.25d-107))) then
tmp = x + ((y - (t / y)) / (z * (-3.0d0)))
else
tmp = x + ((t / (z * 3.0d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.1e-27) || !(y <= 1.25e-107)) {
tmp = x + ((y - (t / y)) / (z * -3.0));
} else {
tmp = x + ((t / (z * 3.0)) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.1e-27) or not (y <= 1.25e-107): tmp = x + ((y - (t / y)) / (z * -3.0)) else: tmp = x + ((t / (z * 3.0)) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.1e-27) || !(y <= 1.25e-107)) tmp = Float64(x + Float64(Float64(y - Float64(t / y)) / Float64(z * -3.0))); else tmp = Float64(x + Float64(Float64(t / Float64(z * 3.0)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.1e-27) || ~((y <= 1.25e-107))) tmp = x + ((y - (t / y)) / (z * -3.0)); else tmp = x + ((t / (z * 3.0)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.1e-27], N[Not[LessEqual[y, 1.25e-107]], $MachinePrecision]], N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-27} \lor \neg \left(y \leq 1.25 \cdot 10^{-107}\right):\\
\;\;\;\;x + \frac{y - \frac{t}{y}}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\end{array}
\end{array}
if y < -3.0999999999999998e-27 or 1.24999999999999993e-107 < y Initial program 97.4%
+-commutative97.4%
associate-+r-97.4%
+-commutative97.4%
associate--l+97.4%
sub-neg97.4%
remove-double-neg97.4%
distribute-frac-neg97.4%
distribute-neg-in97.4%
remove-double-neg97.4%
sub-neg97.4%
neg-mul-197.4%
times-frac99.2%
distribute-frac-neg99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.1%
*-commutative99.1%
Simplified99.7%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
associate-*l/99.7%
*-un-lft-identity99.7%
frac-2neg99.7%
div-inv99.8%
metadata-eval99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Applied egg-rr99.8%
if -3.0999999999999998e-27 < y < 1.24999999999999993e-107Initial program 88.3%
+-commutative88.3%
associate-+r-88.3%
+-commutative88.3%
associate--l+88.3%
sub-neg88.3%
remove-double-neg88.3%
distribute-frac-neg88.3%
distribute-neg-in88.3%
remove-double-neg88.3%
sub-neg88.3%
neg-mul-188.3%
times-frac86.2%
distribute-frac-neg86.2%
neg-mul-186.2%
*-commutative86.2%
associate-/l*86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 86.2%
associate-*r/98.8%
clear-num98.8%
associate-*l/98.9%
*-un-lft-identity98.9%
div-inv98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(if (<= (* z 3.0) -1e-69)
(- x (* y (/ 0.3333333333333333 z)))
(if (<= (* z 3.0) 2e-86)
(* 0.3333333333333333 (/ (- (/ t y) y) z))
(- x (* 0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e-69) {
tmp = x - (y * (0.3333333333333333 / z));
} else if ((z * 3.0) <= 2e-86) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z * 3.0d0) <= (-1d-69)) then
tmp = x - (y * (0.3333333333333333d0 / z))
else if ((z * 3.0d0) <= 2d-86) then
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
else
tmp = x - (0.3333333333333333d0 * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e-69) {
tmp = x - (y * (0.3333333333333333 / z));
} else if ((z * 3.0) <= 2e-86) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -1e-69: tmp = x - (y * (0.3333333333333333 / z)) elif (z * 3.0) <= 2e-86: tmp = 0.3333333333333333 * (((t / y) - y) / z) else: tmp = x - (0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -1e-69) tmp = Float64(x - Float64(y * Float64(0.3333333333333333 / z))); elseif (Float64(z * 3.0) <= 2e-86) tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); else tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -1e-69) tmp = x - (y * (0.3333333333333333 / z)); elseif ((z * 3.0) <= 2e-86) tmp = 0.3333333333333333 * (((t / y) - y) / z); else tmp = x - (0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e-69], N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 2e-86], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-69}:\\
\;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\
\mathbf{elif}\;z \cdot 3 \leq 2 \cdot 10^{-86}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -9.9999999999999996e-70Initial program 97.5%
+-commutative97.5%
associate-+r-97.5%
+-commutative97.5%
associate--l+97.5%
sub-neg97.5%
remove-double-neg97.5%
distribute-frac-neg97.5%
distribute-neg-in97.5%
remove-double-neg97.5%
sub-neg97.5%
neg-mul-197.5%
times-frac93.0%
distribute-frac-neg93.0%
neg-mul-193.0%
*-commutative93.0%
associate-/l*92.9%
*-commutative92.9%
Simplified92.8%
Taylor expanded in t around 0 79.7%
neg-mul-179.7%
Simplified79.7%
add-cube-cbrt78.7%
fma-define78.7%
distribute-rgt-neg-out78.7%
add-sqr-sqrt32.2%
sqrt-unprod42.8%
sqr-neg42.8%
sqrt-unprod29.9%
add-sqr-sqrt51.4%
fma-neg51.4%
*-commutative51.4%
add-cube-cbrt52.3%
add-sqr-sqrt30.3%
sqrt-unprod43.4%
sqr-neg43.4%
sqrt-unprod32.7%
add-sqr-sqrt79.7%
Applied egg-rr79.7%
if -9.9999999999999996e-70 < (*.f64 z #s(literal 3 binary64)) < 2.00000000000000017e-86Initial program 87.4%
+-commutative87.4%
associate-+r-87.4%
sub-neg87.4%
associate-*l*87.4%
*-commutative87.4%
distribute-frac-neg287.4%
distribute-rgt-neg-in87.4%
metadata-eval87.4%
Simplified87.4%
*-un-lft-identity87.4%
*-commutative87.4%
associate-*l*87.4%
*-commutative87.4%
times-frac91.4%
*-un-lft-identity91.4%
*-commutative91.4%
times-frac91.3%
metadata-eval91.3%
Applied egg-rr91.3%
associate-*l/91.4%
*-lft-identity91.4%
associate-*r/91.4%
Simplified91.4%
Taylor expanded in z around 0 95.2%
+-commutative95.2%
metadata-eval95.2%
associate-*r*95.2%
neg-mul-195.2%
distribute-lft-in95.1%
sub-neg95.1%
associate-*r/94.5%
Simplified94.5%
if 2.00000000000000017e-86 < (*.f64 z #s(literal 3 binary64)) Initial program 99.7%
Taylor expanded in t around 0 72.2%
Final simplification83.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.7e-27) (not (<= y 1.85e-107))) (+ x (* 0.3333333333333333 (/ (- (/ t y) y) z))) (+ x (/ (/ t (* z 3.0)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.7e-27) || !(y <= 1.85e-107)) {
tmp = x + (0.3333333333333333 * (((t / y) - y) / z));
} else {
tmp = x + ((t / (z * 3.0)) / 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 <= (-4.7d-27)) .or. (.not. (y <= 1.85d-107))) then
tmp = x + (0.3333333333333333d0 * (((t / y) - y) / z))
else
tmp = x + ((t / (z * 3.0d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.7e-27) || !(y <= 1.85e-107)) {
tmp = x + (0.3333333333333333 * (((t / y) - y) / z));
} else {
tmp = x + ((t / (z * 3.0)) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.7e-27) or not (y <= 1.85e-107): tmp = x + (0.3333333333333333 * (((t / y) - y) / z)) else: tmp = x + ((t / (z * 3.0)) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.7e-27) || !(y <= 1.85e-107)) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z))); else tmp = Float64(x + Float64(Float64(t / Float64(z * 3.0)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.7e-27) || ~((y <= 1.85e-107))) tmp = x + (0.3333333333333333 * (((t / y) - y) / z)); else tmp = x + ((t / (z * 3.0)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.7e-27], N[Not[LessEqual[y, 1.85e-107]], $MachinePrecision]], N[(x + N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{-27} \lor \neg \left(y \leq 1.85 \cdot 10^{-107}\right):\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\end{array}
\end{array}
if y < -4.70000000000000032e-27 or 1.8500000000000001e-107 < y Initial program 97.4%
+-commutative97.4%
associate-+r-97.4%
+-commutative97.4%
associate--l+97.4%
sub-neg97.4%
remove-double-neg97.4%
distribute-frac-neg97.4%
distribute-neg-in97.4%
remove-double-neg97.4%
sub-neg97.4%
neg-mul-197.4%
times-frac99.2%
distribute-frac-neg99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.1%
*-commutative99.1%
Simplified99.7%
Taylor expanded in z around 0 99.2%
if -4.70000000000000032e-27 < y < 1.8500000000000001e-107Initial program 88.3%
+-commutative88.3%
associate-+r-88.3%
+-commutative88.3%
associate--l+88.3%
sub-neg88.3%
remove-double-neg88.3%
distribute-frac-neg88.3%
distribute-neg-in88.3%
remove-double-neg88.3%
sub-neg88.3%
neg-mul-188.3%
times-frac86.2%
distribute-frac-neg86.2%
neg-mul-186.2%
*-commutative86.2%
associate-/l*86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 86.2%
associate-*r/98.8%
clear-num98.8%
associate-*l/98.9%
*-un-lft-identity98.9%
div-inv98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.1e-27) (not (<= y 1.6e-108))) (+ x (* (- (/ t y) y) (/ 0.3333333333333333 z))) (+ x (/ (/ t (* z 3.0)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.1e-27) || !(y <= 1.6e-108)) {
tmp = x + (((t / y) - y) * (0.3333333333333333 / z));
} else {
tmp = x + ((t / (z * 3.0)) / 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 <= (-3.1d-27)) .or. (.not. (y <= 1.6d-108))) then
tmp = x + (((t / y) - y) * (0.3333333333333333d0 / z))
else
tmp = x + ((t / (z * 3.0d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.1e-27) || !(y <= 1.6e-108)) {
tmp = x + (((t / y) - y) * (0.3333333333333333 / z));
} else {
tmp = x + ((t / (z * 3.0)) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.1e-27) or not (y <= 1.6e-108): tmp = x + (((t / y) - y) * (0.3333333333333333 / z)) else: tmp = x + ((t / (z * 3.0)) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.1e-27) || !(y <= 1.6e-108)) tmp = Float64(x + Float64(Float64(Float64(t / y) - y) * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(Float64(t / Float64(z * 3.0)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.1e-27) || ~((y <= 1.6e-108))) tmp = x + (((t / y) - y) * (0.3333333333333333 / z)); else tmp = x + ((t / (z * 3.0)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.1e-27], N[Not[LessEqual[y, 1.6e-108]], $MachinePrecision]], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-27} \lor \neg \left(y \leq 1.6 \cdot 10^{-108}\right):\\
\;\;\;\;x + \left(\frac{t}{y} - y\right) \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\end{array}
\end{array}
if y < -3.0999999999999998e-27 or 1.6e-108 < y Initial program 97.4%
+-commutative97.4%
associate-+r-97.4%
+-commutative97.4%
associate--l+97.4%
sub-neg97.4%
remove-double-neg97.4%
distribute-frac-neg97.4%
distribute-neg-in97.4%
remove-double-neg97.4%
sub-neg97.4%
neg-mul-197.4%
times-frac99.2%
distribute-frac-neg99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.1%
*-commutative99.1%
Simplified99.7%
if -3.0999999999999998e-27 < y < 1.6e-108Initial program 88.3%
+-commutative88.3%
associate-+r-88.3%
+-commutative88.3%
associate--l+88.3%
sub-neg88.3%
remove-double-neg88.3%
distribute-frac-neg88.3%
distribute-neg-in88.3%
remove-double-neg88.3%
sub-neg88.3%
neg-mul-188.3%
times-frac86.2%
distribute-frac-neg86.2%
neg-mul-186.2%
*-commutative86.2%
associate-/l*86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 86.2%
associate-*r/98.8%
clear-num98.8%
associate-*l/98.9%
*-un-lft-identity98.9%
div-inv98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ y (* z -3.0))))
(if (<= t 1e-111)
(+ (+ (/ (/ (* t 0.3333333333333333) z) y) x) t_1)
(+ t_1 (+ x (/ t (* z (* y 3.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = y / (z * -3.0);
double tmp;
if (t <= 1e-111) {
tmp = ((((t * 0.3333333333333333) / z) / y) + x) + t_1;
} else {
tmp = t_1 + (x + (t / (z * (y * 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 (t <= 1d-111) then
tmp = ((((t * 0.3333333333333333d0) / z) / y) + x) + t_1
else
tmp = t_1 + (x + (t / (z * (y * 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 (t <= 1e-111) {
tmp = ((((t * 0.3333333333333333) / z) / y) + x) + t_1;
} else {
tmp = t_1 + (x + (t / (z * (y * 3.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (z * -3.0) tmp = 0 if t <= 1e-111: tmp = ((((t * 0.3333333333333333) / z) / y) + x) + t_1 else: tmp = t_1 + (x + (t / (z * (y * 3.0)))) return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(z * -3.0)) tmp = 0.0 if (t <= 1e-111) tmp = Float64(Float64(Float64(Float64(Float64(t * 0.3333333333333333) / z) / y) + x) + t_1); else tmp = Float64(t_1 + Float64(x + Float64(t / Float64(z * Float64(y * 3.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (z * -3.0); tmp = 0.0; if (t <= 1e-111) tmp = ((((t * 0.3333333333333333) / z) / y) + x) + t_1; else tmp = t_1 + (x + (t / (z * (y * 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[t, 1e-111], N[(N[(N[(N[(N[(t * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z \cdot -3}\\
\mathbf{if}\;t \leq 10^{-111}:\\
\;\;\;\;\left(\frac{\frac{t \cdot 0.3333333333333333}{z}}{y} + x\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\
\end{array}
\end{array}
if t < 1.00000000000000009e-111Initial program 92.5%
+-commutative92.5%
associate-+r-92.5%
sub-neg92.5%
associate-*l*92.5%
*-commutative92.5%
distribute-frac-neg292.5%
distribute-rgt-neg-in92.5%
metadata-eval92.5%
Simplified92.5%
*-un-lft-identity92.5%
*-commutative92.5%
associate-*l*92.5%
*-commutative92.5%
times-frac98.7%
*-un-lft-identity98.7%
*-commutative98.7%
times-frac98.7%
metadata-eval98.7%
Applied egg-rr98.7%
associate-*l/98.7%
*-lft-identity98.7%
associate-*r/98.8%
Simplified98.8%
if 1.00000000000000009e-111 < t Initial program 97.3%
+-commutative97.3%
associate-+r-97.3%
sub-neg97.3%
associate-*l*97.4%
*-commutative97.4%
distribute-frac-neg297.4%
distribute-rgt-neg-in97.4%
metadata-eval97.4%
Simplified97.4%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -10000000000.0) x (if (<= (* z 3.0) 5e+32) (/ y (* z -3.0)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -10000000000.0) {
tmp = x;
} else if ((z * 3.0) <= 5e+32) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z * 3.0d0) <= (-10000000000.0d0)) then
tmp = x
else if ((z * 3.0d0) <= 5d+32) then
tmp = y / (z * (-3.0d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -10000000000.0) {
tmp = x;
} else if ((z * 3.0) <= 5e+32) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -10000000000.0: tmp = x elif (z * 3.0) <= 5e+32: tmp = y / (z * -3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -10000000000.0) tmp = x; elseif (Float64(z * 3.0) <= 5e+32) tmp = Float64(y / Float64(z * -3.0)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -10000000000.0) tmp = x; elseif ((z * 3.0) <= 5e+32) tmp = y / (z * -3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -10000000000.0], x, If[LessEqual[N[(z * 3.0), $MachinePrecision], 5e+32], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -10000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \cdot 3 \leq 5 \cdot 10^{+32}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -1e10 or 4.9999999999999997e32 < (*.f64 z #s(literal 3 binary64)) Initial program 99.0%
+-commutative99.0%
associate-+r-99.0%
+-commutative99.0%
associate--l+99.0%
sub-neg99.0%
remove-double-neg99.0%
distribute-frac-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
sub-neg99.0%
neg-mul-199.0%
times-frac88.9%
distribute-frac-neg88.9%
neg-mul-188.9%
*-commutative88.9%
associate-/l*88.9%
*-commutative88.9%
Simplified88.8%
Taylor expanded in x around inf 57.6%
if -1e10 < (*.f64 z #s(literal 3 binary64)) < 4.9999999999999997e32Initial program 89.4%
+-commutative89.4%
associate-+r-89.4%
sub-neg89.4%
associate-*l*89.4%
*-commutative89.4%
distribute-frac-neg289.4%
distribute-rgt-neg-in89.4%
metadata-eval89.4%
Simplified89.4%
*-un-lft-identity89.4%
*-commutative89.4%
associate-*l*89.4%
*-commutative89.4%
times-frac92.5%
*-un-lft-identity92.5%
*-commutative92.5%
times-frac92.4%
metadata-eval92.4%
Applied egg-rr92.4%
associate-*l/92.5%
*-lft-identity92.5%
associate-*r/92.6%
Simplified92.6%
Taylor expanded in y around inf 46.2%
metadata-eval46.2%
times-frac46.8%
*-un-lft-identity46.8%
*-commutative46.8%
Applied egg-rr46.8%
Final simplification51.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -2e+33)
(- x (* y (/ 0.3333333333333333 z)))
(if (<= y 1.4e+16)
(+ x (* 0.3333333333333333 (/ t (* z y))))
(- x (/ (* 0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e+33) {
tmp = x - (y * (0.3333333333333333 / z));
} else if (y <= 1.4e+16) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2d+33)) then
tmp = x - (y * (0.3333333333333333d0 / z))
else if (y <= 1.4d+16) then
tmp = x + (0.3333333333333333d0 * (t / (z * y)))
else
tmp = x - ((0.3333333333333333d0 * y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e+33) {
tmp = x - (y * (0.3333333333333333 / z));
} else if (y <= 1.4e+16) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2e+33: tmp = x - (y * (0.3333333333333333 / z)) elif y <= 1.4e+16: tmp = x + (0.3333333333333333 * (t / (z * y))) else: tmp = x - ((0.3333333333333333 * y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2e+33) tmp = Float64(x - Float64(y * Float64(0.3333333333333333 / z))); elseif (y <= 1.4e+16) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(z * y)))); else tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2e+33) tmp = x - (y * (0.3333333333333333 / z)); elseif (y <= 1.4e+16) tmp = x + (0.3333333333333333 * (t / (z * y))); else tmp = x - ((0.3333333333333333 * y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2e+33], N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+16], N[(x + N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+33}:\\
\;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+16}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -1.9999999999999999e33Initial program 96.9%
+-commutative96.9%
associate-+r-96.9%
+-commutative96.9%
associate--l+96.9%
sub-neg96.9%
remove-double-neg96.9%
distribute-frac-neg96.9%
distribute-neg-in96.9%
remove-double-neg96.9%
sub-neg96.9%
neg-mul-196.9%
times-frac98.3%
distribute-frac-neg98.3%
neg-mul-198.3%
*-commutative98.3%
associate-/l*98.2%
*-commutative98.2%
Simplified99.7%
Taylor expanded in t around 0 94.9%
neg-mul-194.9%
Simplified94.9%
add-cube-cbrt94.2%
fma-define94.2%
distribute-rgt-neg-out94.2%
add-sqr-sqrt0.0%
sqrt-unprod21.4%
sqr-neg21.4%
sqrt-unprod35.6%
add-sqr-sqrt35.6%
fma-neg35.6%
*-commutative35.6%
add-cube-cbrt36.1%
add-sqr-sqrt36.1%
sqrt-unprod21.7%
sqr-neg21.7%
sqrt-unprod0.0%
add-sqr-sqrt94.9%
Applied egg-rr94.9%
if -1.9999999999999999e33 < y < 1.4e16Initial program 89.4%
+-commutative89.4%
associate-+r-89.4%
+-commutative89.4%
associate--l+89.4%
sub-neg89.4%
remove-double-neg89.4%
distribute-frac-neg89.4%
distribute-neg-in89.4%
remove-double-neg89.4%
sub-neg89.4%
neg-mul-189.4%
times-frac89.2%
distribute-frac-neg89.2%
neg-mul-189.2%
*-commutative89.2%
associate-/l*89.3%
*-commutative89.3%
Simplified89.2%
Taylor expanded in t around inf 86.7%
if 1.4e16 < y Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 88.1%
metadata-eval88.1%
cancel-sign-sub-inv88.1%
associate-*r/89.3%
Simplified89.3%
Final simplification89.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.1e+33)
(- x (* y (/ 0.3333333333333333 z)))
(if (<= y 3.4e+19)
(+ x (* 0.3333333333333333 (/ (/ t z) y)))
(- x (/ (* 0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e+33) {
tmp = x - (y * (0.3333333333333333 / z));
} else if (y <= 3.4e+19) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.1d+33)) then
tmp = x - (y * (0.3333333333333333d0 / z))
else if (y <= 3.4d+19) then
tmp = x + (0.3333333333333333d0 * ((t / z) / y))
else
tmp = x - ((0.3333333333333333d0 * y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e+33) {
tmp = x - (y * (0.3333333333333333 / z));
} else if (y <= 3.4e+19) {
tmp = x + (0.3333333333333333 * ((t / z) / y));
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.1e+33: tmp = x - (y * (0.3333333333333333 / z)) elif y <= 3.4e+19: tmp = x + (0.3333333333333333 * ((t / z) / y)) else: tmp = x - ((0.3333333333333333 * y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e+33) tmp = Float64(x - Float64(y * Float64(0.3333333333333333 / z))); elseif (y <= 3.4e+19) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); else tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.1e+33) tmp = x - (y * (0.3333333333333333 / z)); elseif (y <= 3.4e+19) tmp = x + (0.3333333333333333 * ((t / z) / y)); else tmp = x - ((0.3333333333333333 * y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e+33], N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+19], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+33}:\\
\;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+19}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -3.1e33Initial program 96.9%
+-commutative96.9%
associate-+r-96.9%
+-commutative96.9%
associate--l+96.9%
sub-neg96.9%
remove-double-neg96.9%
distribute-frac-neg96.9%
distribute-neg-in96.9%
remove-double-neg96.9%
sub-neg96.9%
neg-mul-196.9%
times-frac98.3%
distribute-frac-neg98.3%
neg-mul-198.3%
*-commutative98.3%
associate-/l*98.2%
*-commutative98.2%
Simplified99.7%
Taylor expanded in t around 0 94.9%
neg-mul-194.9%
Simplified94.9%
add-cube-cbrt94.2%
fma-define94.2%
distribute-rgt-neg-out94.2%
add-sqr-sqrt0.0%
sqrt-unprod21.4%
sqr-neg21.4%
sqrt-unprod35.6%
add-sqr-sqrt35.6%
fma-neg35.6%
*-commutative35.6%
add-cube-cbrt36.1%
add-sqr-sqrt36.1%
sqrt-unprod21.7%
sqr-neg21.7%
sqrt-unprod0.0%
add-sqr-sqrt94.9%
Applied egg-rr94.9%
if -3.1e33 < y < 3.4e19Initial program 89.4%
+-commutative89.4%
associate-+r-89.4%
+-commutative89.4%
associate--l+89.4%
sub-neg89.4%
remove-double-neg89.4%
distribute-frac-neg89.4%
distribute-neg-in89.4%
remove-double-neg89.4%
sub-neg89.4%
neg-mul-189.4%
times-frac89.2%
distribute-frac-neg89.2%
neg-mul-189.2%
*-commutative89.2%
associate-/l*89.3%
*-commutative89.3%
Simplified89.2%
Taylor expanded in t around inf 86.7%
metadata-eval86.7%
*-commutative86.7%
times-frac86.7%
*-commutative86.7%
associate-*r*86.7%
*-commutative86.7%
times-frac95.7%
associate-*l/95.7%
*-commutative95.7%
times-frac95.6%
metadata-eval95.6%
Simplified95.6%
if 3.4e19 < y Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 88.1%
metadata-eval88.1%
cancel-sign-sub-inv88.1%
associate-*r/89.3%
Simplified89.3%
Final simplification93.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.6e+33)
(- x (* y (/ 0.3333333333333333 z)))
(if (<= y 6.2e+19)
(+ x (/ 0.3333333333333333 (* y (/ z t))))
(- x (/ (* 0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e+33) {
tmp = x - (y * (0.3333333333333333 / z));
} else if (y <= 6.2e+19) {
tmp = x + (0.3333333333333333 / (y * (z / t)));
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.6d+33)) then
tmp = x - (y * (0.3333333333333333d0 / z))
else if (y <= 6.2d+19) then
tmp = x + (0.3333333333333333d0 / (y * (z / t)))
else
tmp = x - ((0.3333333333333333d0 * y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e+33) {
tmp = x - (y * (0.3333333333333333 / z));
} else if (y <= 6.2e+19) {
tmp = x + (0.3333333333333333 / (y * (z / t)));
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.6e+33: tmp = x - (y * (0.3333333333333333 / z)) elif y <= 6.2e+19: tmp = x + (0.3333333333333333 / (y * (z / t))) else: tmp = x - ((0.3333333333333333 * y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.6e+33) tmp = Float64(x - Float64(y * Float64(0.3333333333333333 / z))); elseif (y <= 6.2e+19) tmp = Float64(x + Float64(0.3333333333333333 / Float64(y * Float64(z / t)))); else tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.6e+33) tmp = x - (y * (0.3333333333333333 / z)); elseif (y <= 6.2e+19) tmp = x + (0.3333333333333333 / (y * (z / t))); else tmp = x - ((0.3333333333333333 * y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.6e+33], N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+19], N[(x + N[(0.3333333333333333 / N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+33}:\\
\;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+19}:\\
\;\;\;\;x + \frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -3.6000000000000003e33Initial program 96.9%
+-commutative96.9%
associate-+r-96.9%
+-commutative96.9%
associate--l+96.9%
sub-neg96.9%
remove-double-neg96.9%
distribute-frac-neg96.9%
distribute-neg-in96.9%
remove-double-neg96.9%
sub-neg96.9%
neg-mul-196.9%
times-frac98.3%
distribute-frac-neg98.3%
neg-mul-198.3%
*-commutative98.3%
associate-/l*98.2%
*-commutative98.2%
Simplified99.7%
Taylor expanded in t around 0 94.9%
neg-mul-194.9%
Simplified94.9%
add-cube-cbrt94.2%
fma-define94.2%
distribute-rgt-neg-out94.2%
add-sqr-sqrt0.0%
sqrt-unprod21.4%
sqr-neg21.4%
sqrt-unprod35.6%
add-sqr-sqrt35.6%
fma-neg35.6%
*-commutative35.6%
add-cube-cbrt36.1%
add-sqr-sqrt36.1%
sqrt-unprod21.7%
sqr-neg21.7%
sqrt-unprod0.0%
add-sqr-sqrt94.9%
Applied egg-rr94.9%
if -3.6000000000000003e33 < y < 6.2e19Initial program 89.4%
+-commutative89.4%
associate-+r-89.4%
+-commutative89.4%
associate--l+89.4%
sub-neg89.4%
remove-double-neg89.4%
distribute-frac-neg89.4%
distribute-neg-in89.4%
remove-double-neg89.4%
sub-neg89.4%
neg-mul-189.4%
times-frac89.2%
distribute-frac-neg89.2%
neg-mul-189.2%
*-commutative89.2%
associate-/l*89.3%
*-commutative89.3%
Simplified89.2%
Taylor expanded in t around inf 86.7%
metadata-eval86.7%
*-commutative86.7%
times-frac86.7%
*-commutative86.7%
associate-*r*86.7%
*-commutative86.7%
times-frac95.7%
associate-*l/95.7%
*-commutative95.7%
times-frac95.6%
metadata-eval95.6%
Simplified95.6%
associate-*r/95.6%
metadata-eval95.6%
clear-num95.6%
inv-pow95.6%
unpow-prod-down95.6%
inv-pow95.6%
div-inv95.6%
associate-/r*95.6%
metadata-eval95.6%
frac-times95.6%
metadata-eval95.6%
Applied egg-rr95.6%
if 6.2e19 < y Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 88.1%
metadata-eval88.1%
cancel-sign-sub-inv88.1%
associate-*r/89.3%
Simplified89.3%
Final simplification93.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e+32)
(- x (* y (/ 0.3333333333333333 z)))
(if (<= y 1.9e+20)
(+ x (/ (/ t (* z 3.0)) y))
(- x (/ (* 0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+32) {
tmp = x - (y * (0.3333333333333333 / z));
} else if (y <= 1.9e+20) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.7d+32)) then
tmp = x - (y * (0.3333333333333333d0 / z))
else if (y <= 1.9d+20) then
tmp = x + ((t / (z * 3.0d0)) / y)
else
tmp = x - ((0.3333333333333333d0 * y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e+32) {
tmp = x - (y * (0.3333333333333333 / z));
} else if (y <= 1.9e+20) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e+32: tmp = x - (y * (0.3333333333333333 / z)) elif y <= 1.9e+20: tmp = x + ((t / (z * 3.0)) / y) else: tmp = x - ((0.3333333333333333 * y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e+32) tmp = Float64(x - Float64(y * Float64(0.3333333333333333 / z))); elseif (y <= 1.9e+20) tmp = Float64(x + Float64(Float64(t / Float64(z * 3.0)) / y)); else tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e+32) tmp = x - (y * (0.3333333333333333 / z)); elseif (y <= 1.9e+20) tmp = x + ((t / (z * 3.0)) / y); else tmp = x - ((0.3333333333333333 * y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e+32], N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+20], N[(x + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+32}:\\
\;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+20}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -1.69999999999999989e32Initial program 96.9%
+-commutative96.9%
associate-+r-96.9%
+-commutative96.9%
associate--l+96.9%
sub-neg96.9%
remove-double-neg96.9%
distribute-frac-neg96.9%
distribute-neg-in96.9%
remove-double-neg96.9%
sub-neg96.9%
neg-mul-196.9%
times-frac98.3%
distribute-frac-neg98.3%
neg-mul-198.3%
*-commutative98.3%
associate-/l*98.2%
*-commutative98.2%
Simplified99.7%
Taylor expanded in t around 0 94.9%
neg-mul-194.9%
Simplified94.9%
add-cube-cbrt94.2%
fma-define94.2%
distribute-rgt-neg-out94.2%
add-sqr-sqrt0.0%
sqrt-unprod21.4%
sqr-neg21.4%
sqrt-unprod35.6%
add-sqr-sqrt35.6%
fma-neg35.6%
*-commutative35.6%
add-cube-cbrt36.1%
add-sqr-sqrt36.1%
sqrt-unprod21.7%
sqr-neg21.7%
sqrt-unprod0.0%
add-sqr-sqrt94.9%
Applied egg-rr94.9%
if -1.69999999999999989e32 < y < 1.9e20Initial program 89.4%
+-commutative89.4%
associate-+r-89.4%
+-commutative89.4%
associate--l+89.4%
sub-neg89.4%
remove-double-neg89.4%
distribute-frac-neg89.4%
distribute-neg-in89.4%
remove-double-neg89.4%
sub-neg89.4%
neg-mul-189.4%
times-frac89.2%
distribute-frac-neg89.2%
neg-mul-189.2%
*-commutative89.2%
associate-/l*89.3%
*-commutative89.3%
Simplified89.2%
Taylor expanded in t around inf 85.8%
associate-*r/95.6%
clear-num95.6%
associate-*l/95.6%
*-un-lft-identity95.6%
div-inv95.7%
metadata-eval95.7%
Applied egg-rr95.7%
if 1.9e20 < y Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 88.1%
metadata-eval88.1%
cancel-sign-sub-inv88.1%
associate-*r/89.3%
Simplified89.3%
Final simplification93.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1950000.0) x (if (<= z 2.4e+32) (* (/ y z) -0.3333333333333333) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1950000.0) {
tmp = x;
} else if (z <= 2.4e+32) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1950000.0d0)) then
tmp = x
else if (z <= 2.4d+32) then
tmp = (y / z) * (-0.3333333333333333d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1950000.0) {
tmp = x;
} else if (z <= 2.4e+32) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1950000.0: tmp = x elif z <= 2.4e+32: tmp = (y / z) * -0.3333333333333333 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1950000.0) tmp = x; elseif (z <= 2.4e+32) tmp = Float64(Float64(y / z) * -0.3333333333333333); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1950000.0) tmp = x; elseif (z <= 2.4e+32) tmp = (y / z) * -0.3333333333333333; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1950000.0], x, If[LessEqual[z, 2.4e+32], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1950000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+32}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.95e6 or 2.39999999999999991e32 < z Initial program 99.0%
+-commutative99.0%
associate-+r-99.0%
+-commutative99.0%
associate--l+99.0%
sub-neg99.0%
remove-double-neg99.0%
distribute-frac-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
sub-neg99.0%
neg-mul-199.0%
times-frac88.9%
distribute-frac-neg88.9%
neg-mul-188.9%
*-commutative88.9%
associate-/l*88.9%
*-commutative88.9%
Simplified88.8%
Taylor expanded in x around inf 57.6%
if -1.95e6 < z < 2.39999999999999991e32Initial program 89.4%
+-commutative89.4%
associate-+r-89.4%
sub-neg89.4%
associate-*l*89.4%
*-commutative89.4%
distribute-frac-neg289.4%
distribute-rgt-neg-in89.4%
metadata-eval89.4%
Simplified89.4%
*-un-lft-identity89.4%
*-commutative89.4%
associate-*l*89.4%
*-commutative89.4%
times-frac92.5%
*-un-lft-identity92.5%
*-commutative92.5%
times-frac92.4%
metadata-eval92.4%
Applied egg-rr92.4%
associate-*l/92.5%
*-lft-identity92.5%
associate-*r/92.6%
Simplified92.6%
Taylor expanded in y around inf 46.2%
Final simplification51.6%
(FPCore (x y z t) :precision binary64 (if (<= z -2300000000.0) x (if (<= z 1.4e+33) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2300000000.0) {
tmp = x;
} else if (z <= 1.4e+33) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2300000000.0d0)) then
tmp = x
else if (z <= 1.4d+33) then
tmp = y * ((-0.3333333333333333d0) / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2300000000.0) {
tmp = x;
} else if (z <= 1.4e+33) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2300000000.0: tmp = x elif z <= 1.4e+33: tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2300000000.0) tmp = x; elseif (z <= 1.4e+33) tmp = Float64(y * Float64(-0.3333333333333333 / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2300000000.0) tmp = x; elseif (z <= 1.4e+33) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2300000000.0], x, If[LessEqual[z, 1.4e+33], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2300000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+33}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.3e9 or 1.4e33 < z Initial program 99.0%
+-commutative99.0%
associate-+r-99.0%
+-commutative99.0%
associate--l+99.0%
sub-neg99.0%
remove-double-neg99.0%
distribute-frac-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
sub-neg99.0%
neg-mul-199.0%
times-frac88.9%
distribute-frac-neg88.9%
neg-mul-188.9%
*-commutative88.9%
associate-/l*88.9%
*-commutative88.9%
Simplified88.8%
Taylor expanded in x around inf 57.6%
if -2.3e9 < z < 1.4e33Initial program 89.4%
+-commutative89.4%
associate-+r-89.4%
sub-neg89.4%
associate-*l*89.4%
*-commutative89.4%
distribute-frac-neg289.4%
distribute-rgt-neg-in89.4%
metadata-eval89.4%
Simplified89.4%
*-un-lft-identity89.4%
*-commutative89.4%
associate-*l*89.4%
*-commutative89.4%
times-frac92.5%
*-un-lft-identity92.5%
*-commutative92.5%
times-frac92.4%
metadata-eval92.4%
Applied egg-rr92.4%
associate-*l/92.5%
*-lft-identity92.5%
associate-*r/92.6%
Simplified92.6%
Taylor expanded in y around inf 46.2%
associate-*r/46.8%
metadata-eval46.8%
associate-*r*46.8%
neg-mul-146.8%
associate-*l/46.8%
distribute-rgt-neg-out46.8%
*-commutative46.8%
distribute-rgt-neg-in46.8%
distribute-neg-frac46.8%
metadata-eval46.8%
Simplified46.8%
Final simplification51.9%
(FPCore (x y z t) :precision binary64 (- x (* 0.3333333333333333 (/ y z))))
double code(double x, double y, double z, double t) {
return x - (0.3333333333333333 * (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 / z))
end function
public static double code(double x, double y, double z, double t) {
return x - (0.3333333333333333 * (y / z));
}
def code(x, y, z, t): return x - (0.3333333333333333 * (y / z))
function code(x, y, z, t) return Float64(x - Float64(0.3333333333333333 * Float64(y / z))) end
function tmp = code(x, y, z, t) tmp = x - (0.3333333333333333 * (y / z)); end
code[x_, y_, z_, t_] := N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - 0.3333333333333333 \cdot \frac{y}{z}
\end{array}
Initial program 93.9%
Taylor expanded in t around 0 65.6%
Final simplification65.6%
(FPCore (x y z t) :precision binary64 (- x (* y (/ 0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x - (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 * (0.3333333333333333d0 / z))
end function
public static double code(double x, double y, double z, double t) {
return x - (y * (0.3333333333333333 / z));
}
def code(x, y, z, t): return x - (y * (0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x - Float64(y * Float64(0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x - (y * (0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{0.3333333333333333}{z}
\end{array}
Initial program 93.9%
+-commutative93.9%
associate-+r-93.9%
+-commutative93.9%
associate--l+93.9%
sub-neg93.9%
remove-double-neg93.9%
distribute-frac-neg93.9%
distribute-neg-in93.9%
remove-double-neg93.9%
sub-neg93.9%
neg-mul-193.9%
times-frac94.3%
distribute-frac-neg94.3%
neg-mul-194.3%
*-commutative94.3%
associate-/l*94.2%
*-commutative94.2%
Simplified94.6%
Taylor expanded in t around 0 65.9%
neg-mul-165.9%
Simplified65.9%
add-cube-cbrt65.2%
fma-define65.2%
distribute-rgt-neg-out65.2%
add-sqr-sqrt29.4%
sqrt-unprod40.0%
sqr-neg40.0%
sqrt-unprod19.4%
add-sqr-sqrt32.5%
fma-neg32.5%
*-commutative32.5%
add-cube-cbrt33.1%
add-sqr-sqrt19.7%
sqrt-unprod40.4%
sqr-neg40.4%
sqrt-unprod29.6%
add-sqr-sqrt65.9%
Applied egg-rr65.9%
Final simplification65.9%
(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 93.9%
+-commutative93.9%
associate-+r-93.9%
+-commutative93.9%
associate--l+93.9%
sub-neg93.9%
remove-double-neg93.9%
distribute-frac-neg93.9%
distribute-neg-in93.9%
remove-double-neg93.9%
sub-neg93.9%
neg-mul-193.9%
times-frac94.3%
distribute-frac-neg94.3%
neg-mul-194.3%
*-commutative94.3%
associate-/l*94.2%
*-commutative94.2%
Simplified94.6%
Taylor expanded in x around inf 33.5%
Final simplification33.5%
(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 2024059
(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))))