
(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 16 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 (- (/ t y) y)))
(if (<= y -1.75e-97)
(+ x (/ t_1 (* z 3.0)))
(if (<= y 1.9e-219)
(+ x (/ (/ t (* z 3.0)) y))
(+ x (/ (* 0.3333333333333333 t_1) z))))))
double code(double x, double y, double z, double t) {
double t_1 = (t / y) - y;
double tmp;
if (y <= -1.75e-97) {
tmp = x + (t_1 / (z * 3.0));
} else if (y <= 1.9e-219) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = x + ((0.3333333333333333 * t_1) / 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 = (t / y) - y
if (y <= (-1.75d-97)) then
tmp = x + (t_1 / (z * 3.0d0))
else if (y <= 1.9d-219) then
tmp = x + ((t / (z * 3.0d0)) / y)
else
tmp = x + ((0.3333333333333333d0 * t_1) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t / y) - y;
double tmp;
if (y <= -1.75e-97) {
tmp = x + (t_1 / (z * 3.0));
} else if (y <= 1.9e-219) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = x + ((0.3333333333333333 * t_1) / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / y) - y tmp = 0 if y <= -1.75e-97: tmp = x + (t_1 / (z * 3.0)) elif y <= 1.9e-219: tmp = x + ((t / (z * 3.0)) / y) else: tmp = x + ((0.3333333333333333 * t_1) / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / y) - y) tmp = 0.0 if (y <= -1.75e-97) tmp = Float64(x + Float64(t_1 / Float64(z * 3.0))); elseif (y <= 1.9e-219) tmp = Float64(x + Float64(Float64(t / Float64(z * 3.0)) / y)); else tmp = Float64(x + Float64(Float64(0.3333333333333333 * t_1) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / y) - y; tmp = 0.0; if (y <= -1.75e-97) tmp = x + (t_1 / (z * 3.0)); elseif (y <= 1.9e-219) tmp = x + ((t / (z * 3.0)) / y); else tmp = x + ((0.3333333333333333 * t_1) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[y, -1.75e-97], N[(x + N[(t$95$1 / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-219], N[(x + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 * t$95$1), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{y} - y\\
\mathbf{if}\;y \leq -1.75 \cdot 10^{-97}:\\
\;\;\;\;x + \frac{t\_1}{z \cdot 3}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-219}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333 \cdot t\_1}{z}\\
\end{array}
\end{array}
if y < -1.7500000000000001e-97Initial program 95.8%
Simplified98.6%
metadata-eval98.6%
associate-/r*98.7%
*-commutative98.7%
associate-*l/98.7%
*-un-lft-identity98.7%
Applied egg-rr98.7%
if -1.7500000000000001e-97 < y < 1.90000000000000012e-219Initial program 79.6%
Simplified86.1%
Taylor expanded in y around 0 79.7%
+-commutative79.7%
associate-/r*86.1%
associate-*r/86.0%
associate-*l/86.1%
*-commutative86.1%
associate-*l/99.6%
Simplified99.6%
clear-num99.6%
un-div-inv99.5%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
if 1.90000000000000012e-219 < y Initial program 96.7%
Simplified98.8%
associate-*l/98.9%
Applied egg-rr98.9%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (<= t 1.9e+102) (+ x (fma -0.3333333333333333 (/ y z) (/ (/ t z) (* y 3.0)))) (+ (- x (/ y (* z 3.0))) (/ t (* z (* y 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.9e+102) {
tmp = x + fma(-0.3333333333333333, (y / z), ((t / z) / (y * 3.0)));
} else {
tmp = (x - (y / (z * 3.0))) + (t / (z * (y * 3.0)));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 1.9e+102) tmp = Float64(x + fma(-0.3333333333333333, Float64(y / z), Float64(Float64(t / z) / Float64(y * 3.0)))); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(z * Float64(y * 3.0)))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.9e+102], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.9 \cdot 10^{+102}:\\
\;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{\frac{t}{z}}{y \cdot 3}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\end{array}
\end{array}
if t < 1.89999999999999989e102Initial program 91.4%
associate-+l-91.4%
sub-neg91.4%
remove-double-neg91.4%
distribute-neg-in91.4%
*-lft-identity91.4%
metadata-eval91.4%
times-frac91.4%
neg-mul-191.4%
distribute-rgt-neg-out91.4%
associate-*r/91.4%
neg-mul-191.4%
distribute-neg-out91.4%
neg-mul-191.4%
distribute-lft-neg-in91.4%
metadata-eval91.4%
*-lft-identity91.4%
Simplified91.3%
*-commutative91.3%
associate-*l*91.4%
*-commutative91.4%
associate-/r*98.9%
div-inv98.9%
Applied egg-rr98.9%
un-div-inv98.9%
Applied egg-rr98.9%
if 1.89999999999999989e102 < t Initial program 97.5%
associate-*l*97.6%
*-commutative97.6%
Simplified97.6%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.2e-99) (not (<= y 5.6e-219))) (+ 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 <= -5.2e-99) || !(y <= 5.6e-219)) {
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 <= (-5.2d-99)) .or. (.not. (y <= 5.6d-219))) 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 <= -5.2e-99) || !(y <= 5.6e-219)) {
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 <= -5.2e-99) or not (y <= 5.6e-219): 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 <= -5.2e-99) || !(y <= 5.6e-219)) 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 <= -5.2e-99) || ~((y <= 5.6e-219))) 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, -5.2e-99], N[Not[LessEqual[y, 5.6e-219]], $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 -5.2 \cdot 10^{-99} \lor \neg \left(y \leq 5.6 \cdot 10^{-219}\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 < -5.2000000000000001e-99 or 5.5999999999999998e-219 < y Initial program 96.3%
Simplified98.7%
Taylor expanded in z around 0 98.7%
if -5.2000000000000001e-99 < y < 5.5999999999999998e-219Initial program 79.6%
Simplified86.1%
Taylor expanded in y around 0 79.7%
+-commutative79.7%
associate-/r*86.1%
associate-*r/86.0%
associate-*l/86.1%
*-commutative86.1%
associate-*l/99.6%
Simplified99.6%
clear-num99.6%
un-div-inv99.5%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.2e-98) (not (<= y 8.5e-220))) (+ 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 <= -6.2e-98) || !(y <= 8.5e-220)) {
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 <= (-6.2d-98)) .or. (.not. (y <= 8.5d-220))) 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 <= -6.2e-98) || !(y <= 8.5e-220)) {
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 <= -6.2e-98) or not (y <= 8.5e-220): 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 <= -6.2e-98) || !(y <= 8.5e-220)) tmp = Float64(x + Float64(Float64(0.3333333333333333 * 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 <= -6.2e-98) || ~((y <= 8.5e-220))) 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, -6.2e-98], N[Not[LessEqual[y, 8.5e-220]], $MachinePrecision]], N[(x + N[(N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $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 -6.2 \cdot 10^{-98} \lor \neg \left(y \leq 8.5 \cdot 10^{-220}\right):\\
\;\;\;\;x + \frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\end{array}
\end{array}
if y < -6.2e-98 or 8.4999999999999996e-220 < y Initial program 96.3%
Simplified98.7%
associate-*l/98.8%
Applied egg-rr98.8%
if -6.2e-98 < y < 8.4999999999999996e-220Initial program 79.6%
Simplified86.1%
Taylor expanded in y around 0 79.7%
+-commutative79.7%
associate-/r*86.1%
associate-*r/86.0%
associate-*l/86.1%
*-commutative86.1%
associate-*l/99.6%
Simplified99.6%
clear-num99.6%
un-div-inv99.5%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ t y) y)))
(if (<= y -3e-99)
(+ x (* 0.3333333333333333 (/ t_1 z)))
(if (<= y 5.8e-219)
(+ x (/ (/ t (* z 3.0)) y))
(+ x (* t_1 (/ 0.3333333333333333 z)))))))
double code(double x, double y, double z, double t) {
double t_1 = (t / y) - y;
double tmp;
if (y <= -3e-99) {
tmp = x + (0.3333333333333333 * (t_1 / z));
} else if (y <= 5.8e-219) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = x + (t_1 * (0.3333333333333333 / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (t / y) - y
if (y <= (-3d-99)) then
tmp = x + (0.3333333333333333d0 * (t_1 / z))
else if (y <= 5.8d-219) then
tmp = x + ((t / (z * 3.0d0)) / y)
else
tmp = x + (t_1 * (0.3333333333333333d0 / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t / y) - y;
double tmp;
if (y <= -3e-99) {
tmp = x + (0.3333333333333333 * (t_1 / z));
} else if (y <= 5.8e-219) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = x + (t_1 * (0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / y) - y tmp = 0 if y <= -3e-99: tmp = x + (0.3333333333333333 * (t_1 / z)) elif y <= 5.8e-219: tmp = x + ((t / (z * 3.0)) / y) else: tmp = x + (t_1 * (0.3333333333333333 / z)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / y) - y) tmp = 0.0 if (y <= -3e-99) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t_1 / z))); elseif (y <= 5.8e-219) tmp = Float64(x + Float64(Float64(t / Float64(z * 3.0)) / y)); else tmp = Float64(x + Float64(t_1 * Float64(0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / y) - y; tmp = 0.0; if (y <= -3e-99) tmp = x + (0.3333333333333333 * (t_1 / z)); elseif (y <= 5.8e-219) tmp = x + ((t / (z * 3.0)) / y); else tmp = x + (t_1 * (0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[y, -3e-99], N[(x + N[(0.3333333333333333 * N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-219], N[(x + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$1 * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{y} - y\\
\mathbf{if}\;y \leq -3 \cdot 10^{-99}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t\_1}{z}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-219}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1 \cdot \frac{0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -3.00000000000000006e-99Initial program 95.8%
Simplified98.6%
Taylor expanded in z around 0 98.7%
if -3.00000000000000006e-99 < y < 5.79999999999999968e-219Initial program 79.6%
Simplified86.1%
Taylor expanded in y around 0 79.7%
+-commutative79.7%
associate-/r*86.1%
associate-*r/86.0%
associate-*l/86.1%
*-commutative86.1%
associate-*l/99.6%
Simplified99.6%
clear-num99.6%
un-div-inv99.5%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
if 5.79999999999999968e-219 < y Initial program 96.7%
Simplified98.8%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(if (<= y 2.4e-222)
(+
x
(+ (* y (/ -0.3333333333333333 z)) (* 0.3333333333333333 (/ (/ t z) y))))
(+ x (/ (* 0.3333333333333333 (- (/ t y) y)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.4e-222) {
tmp = x + ((y * (-0.3333333333333333 / z)) + (0.3333333333333333 * ((t / z) / y)));
} 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 (y <= 2.4d-222) then
tmp = x + ((y * ((-0.3333333333333333d0) / z)) + (0.3333333333333333d0 * ((t / z) / y)))
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 (y <= 2.4e-222) {
tmp = x + ((y * (-0.3333333333333333 / z)) + (0.3333333333333333 * ((t / z) / y)));
} else {
tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.4e-222: tmp = x + ((y * (-0.3333333333333333 / z)) + (0.3333333333333333 * ((t / z) / y))) else: tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.4e-222) tmp = Float64(x + Float64(Float64(y * Float64(-0.3333333333333333 / z)) + Float64(0.3333333333333333 * Float64(Float64(t / z) / y)))); 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 (y <= 2.4e-222) tmp = x + ((y * (-0.3333333333333333 / z)) + (0.3333333333333333 * ((t / z) / y))); else tmp = x + ((0.3333333333333333 * ((t / y) - y)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.4e-222], N[(x + N[(N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $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}\;y \leq 2.4 \cdot 10^{-222}:\\
\;\;\;\;x + \left(y \cdot \frac{-0.3333333333333333}{z} + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}\\
\end{array}
\end{array}
if y < 2.39999999999999993e-222Initial program 89.9%
associate-+l-89.9%
sub-neg89.9%
remove-double-neg89.9%
distribute-neg-in89.9%
*-lft-identity89.9%
metadata-eval89.9%
times-frac89.9%
neg-mul-189.9%
distribute-rgt-neg-out89.9%
associate-*r/89.9%
neg-mul-189.9%
distribute-neg-out89.9%
neg-mul-189.9%
distribute-lft-neg-in89.9%
metadata-eval89.9%
*-lft-identity89.9%
Simplified89.9%
*-commutative89.9%
associate-*l*90.0%
*-commutative90.0%
associate-/r*98.5%
div-inv98.4%
Applied egg-rr98.4%
un-div-inv98.5%
Applied egg-rr98.5%
fma-udef98.5%
metadata-eval98.5%
times-frac98.5%
*-commutative98.5%
*-un-lft-identity98.5%
associate-*r/98.4%
*-un-lft-identity98.4%
*-commutative98.4%
times-frac98.4%
metadata-eval98.4%
Applied egg-rr98.4%
if 2.39999999999999993e-222 < y Initial program 95.8%
Simplified98.8%
associate-*l/98.9%
Applied egg-rr98.9%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(if (<= t 3.1e-55)
(+
x
(+ (* y (/ -0.3333333333333333 z)) (* 0.3333333333333333 (/ (/ t z) y))))
(+ (- x (/ y (* z 3.0))) (/ t (* z (* y 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.1e-55) {
tmp = x + ((y * (-0.3333333333333333 / z)) + (0.3333333333333333 * ((t / z) / y)));
} else {
tmp = (x - (y / (z * 3.0))) + (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) :: tmp
if (t <= 3.1d-55) then
tmp = x + ((y * ((-0.3333333333333333d0) / z)) + (0.3333333333333333d0 * ((t / z) / y)))
else
tmp = (x - (y / (z * 3.0d0))) + (t / (z * (y * 3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.1e-55) {
tmp = x + ((y * (-0.3333333333333333 / z)) + (0.3333333333333333 * ((t / z) / y)));
} else {
tmp = (x - (y / (z * 3.0))) + (t / (z * (y * 3.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.1e-55: tmp = x + ((y * (-0.3333333333333333 / z)) + (0.3333333333333333 * ((t / z) / y))) else: tmp = (x - (y / (z * 3.0))) + (t / (z * (y * 3.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.1e-55) tmp = Float64(x + Float64(Float64(y * Float64(-0.3333333333333333 / z)) + Float64(0.3333333333333333 * Float64(Float64(t / z) / y)))); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(z * Float64(y * 3.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.1e-55) tmp = x + ((y * (-0.3333333333333333 / z)) + (0.3333333333333333 * ((t / z) / y))); else tmp = (x - (y / (z * 3.0))) + (t / (z * (y * 3.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.1e-55], N[(x + N[(N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.1 \cdot 10^{-55}:\\
\;\;\;\;x + \left(y \cdot \frac{-0.3333333333333333}{z} + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\end{array}
\end{array}
if t < 3.09999999999999997e-55Initial program 90.4%
associate-+l-90.4%
sub-neg90.4%
remove-double-neg90.4%
distribute-neg-in90.4%
*-lft-identity90.4%
metadata-eval90.4%
times-frac90.4%
neg-mul-190.4%
distribute-rgt-neg-out90.4%
associate-*r/90.4%
neg-mul-190.4%
distribute-neg-out90.4%
neg-mul-190.4%
distribute-lft-neg-in90.4%
metadata-eval90.4%
*-lft-identity90.4%
Simplified90.4%
*-commutative90.4%
associate-*l*90.4%
*-commutative90.4%
associate-/r*98.8%
div-inv98.8%
Applied egg-rr98.8%
un-div-inv98.8%
Applied egg-rr98.8%
fma-udef98.8%
metadata-eval98.8%
times-frac98.8%
*-commutative98.8%
*-un-lft-identity98.8%
associate-*r/98.8%
*-un-lft-identity98.8%
*-commutative98.8%
times-frac98.7%
metadata-eval98.7%
Applied egg-rr98.7%
if 3.09999999999999997e-55 < t Initial program 98.2%
associate-*l*98.4%
*-commutative98.4%
Simplified98.4%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -900000000000.0)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 120000.0)
(+ 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 <= -900000000000.0) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 120000.0) {
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 <= (-900000000000.0d0)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 120000.0d0) 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 <= -900000000000.0) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 120000.0) {
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 <= -900000000000.0: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 120000.0: 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 <= -900000000000.0) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 120000.0) 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 <= -900000000000.0) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 120000.0) 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, -900000000000.0], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 120000.0], 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 -900000000000:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 120000:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -9e11Initial program 97.1%
Simplified99.7%
Taylor expanded in t around 0 92.7%
+-commutative92.7%
Simplified92.7%
associate-*r/92.8%
Applied egg-rr92.8%
if -9e11 < y < 1.2e5Initial program 86.8%
Simplified92.1%
Taylor expanded in t around inf 82.8%
if 1.2e5 < y Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-neg-in99.8%
*-lft-identity99.8%
metadata-eval99.8%
times-frac99.8%
neg-mul-199.8%
distribute-rgt-neg-out99.8%
associate-*r/99.8%
neg-mul-199.8%
distribute-neg-out99.8%
neg-mul-199.8%
distribute-lft-neg-in99.8%
metadata-eval99.8%
*-lft-identity99.8%
Simplified99.7%
*-commutative99.7%
associate-*l*99.7%
*-commutative99.7%
associate-/r*90.6%
div-inv90.6%
Applied egg-rr90.6%
Taylor expanded in y around inf 92.8%
associate-*r/92.9%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in z around 0 92.8%
metadata-eval92.8%
times-frac92.9%
*-commutative92.9%
neg-mul-192.9%
/-rgt-identity92.9%
associate-/l*93.0%
metadata-eval93.0%
associate-/l/92.9%
distribute-lft-neg-in92.9%
distribute-rgt-neg-in92.9%
metadata-eval92.9%
Simplified92.9%
Final simplification87.6%
(FPCore (x y z t) :precision binary64 (if (<= y -650000000000.0) (+ x (/ (* -0.3333333333333333 y) z)) (if (<= y 75000.0) (+ x (/ t (* z (* y 3.0)))) (+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -650000000000.0) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 75000.0) {
tmp = x + (t / (z * (y * 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 <= (-650000000000.0d0)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 75000.0d0) then
tmp = x + (t / (z * (y * 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 <= -650000000000.0) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 75000.0) {
tmp = x + (t / (z * (y * 3.0)));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -650000000000.0: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 75000.0: tmp = x + (t / (z * (y * 3.0))) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -650000000000.0) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 75000.0) tmp = Float64(x + Float64(t / Float64(z * Float64(y * 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 <= -650000000000.0) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 75000.0) tmp = x + (t / (z * (y * 3.0))); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -650000000000.0], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 75000.0], N[(x + N[(t / N[(z * N[(y * 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 -650000000000:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 75000:\\
\;\;\;\;x + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -6.5e11Initial program 97.1%
Simplified99.7%
Taylor expanded in t around 0 92.7%
+-commutative92.7%
Simplified92.7%
associate-*r/92.8%
Applied egg-rr92.8%
if -6.5e11 < y < 75000Initial program 86.8%
Simplified92.1%
Taylor expanded in t around inf 82.8%
associate-*r/82.8%
associate-/l/94.1%
associate-*l/94.2%
associate-*l/82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in z around 0 82.3%
clear-num82.2%
un-div-inv82.8%
div-inv82.8%
*-commutative82.8%
metadata-eval82.8%
Applied egg-rr82.8%
Taylor expanded in z around 0 82.8%
associate-*r*82.9%
*-commutative82.9%
*-commutative82.9%
Simplified82.9%
if 75000 < y Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-neg-in99.8%
*-lft-identity99.8%
metadata-eval99.8%
times-frac99.8%
neg-mul-199.8%
distribute-rgt-neg-out99.8%
associate-*r/99.8%
neg-mul-199.8%
distribute-neg-out99.8%
neg-mul-199.8%
distribute-lft-neg-in99.8%
metadata-eval99.8%
*-lft-identity99.8%
Simplified99.7%
*-commutative99.7%
associate-*l*99.7%
*-commutative99.7%
associate-/r*90.6%
div-inv90.6%
Applied egg-rr90.6%
Taylor expanded in y around inf 92.8%
associate-*r/92.9%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in z around 0 92.8%
metadata-eval92.8%
times-frac92.9%
*-commutative92.9%
neg-mul-192.9%
/-rgt-identity92.9%
associate-/l*93.0%
metadata-eval93.0%
associate-/l/92.9%
distribute-lft-neg-in92.9%
distribute-rgt-neg-in92.9%
metadata-eval92.9%
Simplified92.9%
Final simplification87.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -220000000000.0)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 720000.0)
(+ 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 <= -220000000000.0) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 720000.0) {
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 <= (-220000000000.0d0)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 720000.0d0) 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 <= -220000000000.0) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 720000.0) {
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 <= -220000000000.0: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 720000.0: 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 <= -220000000000.0) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 720000.0) tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / 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 <= -220000000000.0) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 720000.0) 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, -220000000000.0], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 720000.0], N[(x + N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] / 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 -220000000000:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 720000:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -2.2e11Initial program 97.1%
Simplified99.7%
Taylor expanded in t around 0 92.7%
+-commutative92.7%
Simplified92.7%
associate-*r/92.8%
Applied egg-rr92.8%
if -2.2e11 < y < 7.2e5Initial program 86.8%
associate-+l-86.8%
sub-neg86.8%
remove-double-neg86.8%
distribute-neg-in86.8%
*-lft-identity86.8%
metadata-eval86.8%
times-frac86.8%
neg-mul-186.8%
distribute-rgt-neg-out86.8%
associate-*r/86.8%
neg-mul-186.8%
distribute-neg-out86.8%
neg-mul-186.8%
distribute-lft-neg-in86.8%
metadata-eval86.8%
*-lft-identity86.8%
Simplified86.8%
*-commutative86.8%
associate-*l*86.9%
*-commutative86.9%
associate-/r*99.1%
div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in y around 0 82.8%
+-commutative82.8%
associate-/r*87.3%
Simplified87.3%
if 7.2e5 < y Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-neg-in99.8%
*-lft-identity99.8%
metadata-eval99.8%
times-frac99.8%
neg-mul-199.8%
distribute-rgt-neg-out99.8%
associate-*r/99.8%
neg-mul-199.8%
distribute-neg-out99.8%
neg-mul-199.8%
distribute-lft-neg-in99.8%
metadata-eval99.8%
*-lft-identity99.8%
Simplified99.7%
*-commutative99.7%
associate-*l*99.7%
*-commutative99.7%
associate-/r*90.6%
div-inv90.6%
Applied egg-rr90.6%
Taylor expanded in y around inf 92.8%
associate-*r/92.9%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in z around 0 92.8%
metadata-eval92.8%
times-frac92.9%
*-commutative92.9%
neg-mul-192.9%
/-rgt-identity92.9%
associate-/l*93.0%
metadata-eval93.0%
associate-/l/92.9%
distribute-lft-neg-in92.9%
distribute-rgt-neg-in92.9%
metadata-eval92.9%
Simplified92.9%
Final simplification89.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -1800000000000.0)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 5000.0)
(+ x (/ (* t (/ 0.3333333333333333 z)) y))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1800000000000.0) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 5000.0) {
tmp = x + ((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 <= (-1800000000000.0d0)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 5000.0d0) then
tmp = x + ((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 <= -1800000000000.0) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 5000.0) {
tmp = x + ((t * (0.3333333333333333 / z)) / y);
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1800000000000.0: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 5000.0: tmp = x + ((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 <= -1800000000000.0) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 5000.0) tmp = Float64(x + Float64(Float64(t * Float64(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 <= -1800000000000.0) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 5000.0) tmp = x + ((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, -1800000000000.0], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5000.0], N[(x + N[(N[(t * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1800000000000:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 5000:\\
\;\;\;\;x + \frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -1.8e12Initial program 97.1%
Simplified99.7%
Taylor expanded in t around 0 92.7%
+-commutative92.7%
Simplified92.7%
associate-*r/92.8%
Applied egg-rr92.8%
if -1.8e12 < y < 5e3Initial program 86.8%
Simplified92.1%
Taylor expanded in y around 0 82.8%
+-commutative82.8%
associate-/r*87.3%
associate-*r/87.3%
associate-*l/87.4%
*-commutative87.4%
associate-*l/94.2%
Simplified94.2%
if 5e3 < y Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-neg-in99.8%
*-lft-identity99.8%
metadata-eval99.8%
times-frac99.8%
neg-mul-199.8%
distribute-rgt-neg-out99.8%
associate-*r/99.8%
neg-mul-199.8%
distribute-neg-out99.8%
neg-mul-199.8%
distribute-lft-neg-in99.8%
metadata-eval99.8%
*-lft-identity99.8%
Simplified99.7%
*-commutative99.7%
associate-*l*99.7%
*-commutative99.7%
associate-/r*90.6%
div-inv90.6%
Applied egg-rr90.6%
Taylor expanded in y around inf 92.8%
associate-*r/92.9%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in z around 0 92.8%
metadata-eval92.8%
times-frac92.9%
*-commutative92.9%
neg-mul-192.9%
/-rgt-identity92.9%
associate-/l*93.0%
metadata-eval93.0%
associate-/l/92.9%
distribute-lft-neg-in92.9%
distribute-rgt-neg-in92.9%
metadata-eval92.9%
Simplified92.9%
Final simplification93.5%
(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 92.3%
Simplified95.7%
Taylor expanded in t around 0 58.9%
metadata-eval58.9%
distribute-lft-neg-in58.9%
associate-*r/58.9%
associate-*l/58.8%
*-commutative58.8%
distribute-rgt-neg-in58.8%
distribute-neg-frac58.8%
metadata-eval58.8%
Simplified58.8%
Final simplification58.8%
(FPCore (x y z t) :precision binary64 (+ x (/ -0.3333333333333333 (/ z y))))
double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 / (z / 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 + ((-0.3333333333333333d0) / (z / y))
end function
public static double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 / (z / y));
}
def code(x, y, z, t): return x + (-0.3333333333333333 / (z / y))
function code(x, y, z, t) return Float64(x + Float64(-0.3333333333333333 / Float64(z / y))) end
function tmp = code(x, y, z, t) tmp = x + (-0.3333333333333333 / (z / y)); end
code[x_, y_, z_, t_] := N[(x + N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333}{\frac{z}{y}}
\end{array}
Initial program 92.3%
associate-+l-92.3%
sub-neg92.3%
remove-double-neg92.3%
distribute-neg-in92.3%
*-lft-identity92.3%
metadata-eval92.3%
times-frac92.3%
neg-mul-192.3%
distribute-rgt-neg-out92.3%
associate-*r/92.3%
neg-mul-192.3%
distribute-neg-out92.3%
neg-mul-192.3%
distribute-lft-neg-in92.3%
metadata-eval92.3%
*-lft-identity92.3%
Simplified92.3%
*-commutative92.3%
associate-*l*92.3%
*-commutative92.3%
associate-/r*96.7%
div-inv96.6%
Applied egg-rr96.6%
Taylor expanded in y around inf 58.9%
associate-*r/58.9%
associate-/l*58.9%
Simplified58.9%
Final simplification58.9%
(FPCore (x y z t) :precision binary64 (+ x (/ y (* z -3.0))))
double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (y / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
def code(x, y, z, t): return x + (y / (z * -3.0))
function code(x, y, z, t) return Float64(x + Float64(y / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = x + (y / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{z \cdot -3}
\end{array}
Initial program 92.3%
associate-+l-92.3%
sub-neg92.3%
remove-double-neg92.3%
distribute-neg-in92.3%
*-lft-identity92.3%
metadata-eval92.3%
times-frac92.3%
neg-mul-192.3%
distribute-rgt-neg-out92.3%
associate-*r/92.3%
neg-mul-192.3%
distribute-neg-out92.3%
neg-mul-192.3%
distribute-lft-neg-in92.3%
metadata-eval92.3%
*-lft-identity92.3%
Simplified92.3%
*-commutative92.3%
associate-*l*92.3%
*-commutative92.3%
associate-/r*96.7%
div-inv96.6%
Applied egg-rr96.6%
Taylor expanded in y around inf 58.9%
associate-*r/58.9%
associate-/l*58.9%
Simplified58.9%
Taylor expanded in z around 0 58.9%
metadata-eval58.9%
times-frac58.9%
*-commutative58.9%
neg-mul-158.9%
/-rgt-identity58.9%
associate-/l*58.9%
metadata-eval58.9%
associate-/l/58.9%
distribute-lft-neg-in58.9%
distribute-rgt-neg-in58.9%
metadata-eval58.9%
Simplified58.9%
Final simplification58.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(Float64(-0.3333333333333333 * 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[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333 \cdot y}{z}
\end{array}
Initial program 92.3%
Simplified95.7%
Taylor expanded in t around 0 58.9%
+-commutative58.9%
Simplified58.9%
associate-*r/58.9%
Applied egg-rr58.9%
Final simplification58.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 92.3%
Simplified95.7%
Taylor expanded in x around inf 24.2%
Final simplification24.2%
(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 2024041
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))