
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (/ y (* z 3.0)))))
(if (<= (+ t_1 (/ t (* y (* z 3.0)))) 5e+307)
(+ t_1 (/ t (* 3.0 (* y z))))
(+ x (/ 0.3333333333333333 (/ z (- (/ t y) y)))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y / (z * 3.0));
double tmp;
if ((t_1 + (t / (y * (z * 3.0)))) <= 5e+307) {
tmp = t_1 + (t / (3.0 * (y * z)));
} else {
tmp = x + (0.3333333333333333 / (z / ((t / y) - 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) :: t_1
real(8) :: tmp
t_1 = x - (y / (z * 3.0d0))
if ((t_1 + (t / (y * (z * 3.0d0)))) <= 5d+307) then
tmp = t_1 + (t / (3.0d0 * (y * z)))
else
tmp = x + (0.3333333333333333d0 / (z / ((t / y) - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (y / (z * 3.0));
double tmp;
if ((t_1 + (t / (y * (z * 3.0)))) <= 5e+307) {
tmp = t_1 + (t / (3.0 * (y * z)));
} else {
tmp = x + (0.3333333333333333 / (z / ((t / y) - y)));
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y / (z * 3.0)) tmp = 0 if (t_1 + (t / (y * (z * 3.0)))) <= 5e+307: tmp = t_1 + (t / (3.0 * (y * z))) else: tmp = x + (0.3333333333333333 / (z / ((t / y) - y))) return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y / Float64(z * 3.0))) tmp = 0.0 if (Float64(t_1 + Float64(t / Float64(y * Float64(z * 3.0)))) <= 5e+307) tmp = Float64(t_1 + Float64(t / Float64(3.0 * Float64(y * z)))); else tmp = Float64(x + Float64(0.3333333333333333 / Float64(z / Float64(Float64(t / y) - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y / (z * 3.0)); tmp = 0.0; if ((t_1 + (t / (y * (z * 3.0)))) <= 5e+307) tmp = t_1 + (t / (3.0 * (y * z))); else tmp = x + (0.3333333333333333 / (z / ((t / y) - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+307], N[(t$95$1 + N[(t / N[(3.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 / N[(z / N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y}{z \cdot 3}\\
\mathbf{if}\;t_1 + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 5 \cdot 10^{+307}:\\
\;\;\;\;t_1 + \frac{t}{3 \cdot \left(y \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{\frac{z}{\frac{t}{y} - y}}\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) < 5e307Initial program 98.5%
Taylor expanded in z around 0 98.5%
if 5e307 < (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) Initial program 82.3%
associate-+l-82.3%
sub-neg82.3%
sub-neg82.3%
distribute-neg-in82.3%
unsub-neg82.3%
neg-mul-182.3%
associate-*r/82.3%
associate-*l/82.3%
distribute-neg-frac82.3%
neg-mul-182.3%
times-frac95.3%
distribute-lft-out--99.9%
*-commutative99.9%
associate-/r*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 82.3%
+-commutative82.3%
metadata-eval82.3%
cancel-sign-sub-inv82.3%
associate-/r*95.4%
associate-*r/95.4%
associate-*r/95.4%
div-sub99.9%
distribute-lft-out--99.9%
Simplified99.9%
*-un-lft-identity99.9%
associate-/l*100.0%
Applied egg-rr100.0%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ y (* z -3.0))))
(if (<= y -6.2e+127)
(* y (/ -0.3333333333333333 z))
(if (<= y -3.2e+95)
x
(if (<= y -95000000000.0)
t_1
(if (<= y -7e-86)
x
(if (<= y 1.5e+28) (* 0.3333333333333333 (/ t (* y z))) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = y / (z * -3.0);
double tmp;
if (y <= -6.2e+127) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= -3.2e+95) {
tmp = x;
} else if (y <= -95000000000.0) {
tmp = t_1;
} else if (y <= -7e-86) {
tmp = x;
} else if (y <= 1.5e+28) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y / (z * (-3.0d0))
if (y <= (-6.2d+127)) then
tmp = y * ((-0.3333333333333333d0) / z)
else if (y <= (-3.2d+95)) then
tmp = x
else if (y <= (-95000000000.0d0)) then
tmp = t_1
else if (y <= (-7d-86)) then
tmp = x
else if (y <= 1.5d+28) then
tmp = 0.3333333333333333d0 * (t / (y * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y / (z * -3.0);
double tmp;
if (y <= -6.2e+127) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= -3.2e+95) {
tmp = x;
} else if (y <= -95000000000.0) {
tmp = t_1;
} else if (y <= -7e-86) {
tmp = x;
} else if (y <= 1.5e+28) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (z * -3.0) tmp = 0 if y <= -6.2e+127: tmp = y * (-0.3333333333333333 / z) elif y <= -3.2e+95: tmp = x elif y <= -95000000000.0: tmp = t_1 elif y <= -7e-86: tmp = x elif y <= 1.5e+28: tmp = 0.3333333333333333 * (t / (y * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(z * -3.0)) tmp = 0.0 if (y <= -6.2e+127) tmp = Float64(y * Float64(-0.3333333333333333 / z)); elseif (y <= -3.2e+95) tmp = x; elseif (y <= -95000000000.0) tmp = t_1; elseif (y <= -7e-86) tmp = x; elseif (y <= 1.5e+28) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (z * -3.0); tmp = 0.0; if (y <= -6.2e+127) tmp = y * (-0.3333333333333333 / z); elseif (y <= -3.2e+95) tmp = x; elseif (y <= -95000000000.0) tmp = t_1; elseif (y <= -7e-86) tmp = x; elseif (y <= 1.5e+28) tmp = 0.3333333333333333 * (t / (y * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+127], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.2e+95], x, If[LessEqual[y, -95000000000.0], t$95$1, If[LessEqual[y, -7e-86], x, If[LessEqual[y, 1.5e+28], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z \cdot -3}\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+127}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{+95}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -95000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-86}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+28}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -6.2000000000000005e127Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in y around inf 83.6%
associate-*r/83.7%
*-commutative83.7%
associate-*r/83.7%
Simplified83.7%
if -6.2000000000000005e127 < y < -3.2000000000000001e95 or -9.5e10 < y < -7.00000000000000041e-86Initial program 92.5%
associate-+l-92.5%
sub-neg92.5%
sub-neg92.5%
distribute-neg-in92.5%
unsub-neg92.5%
neg-mul-192.5%
associate-*r/92.5%
associate-*l/92.6%
distribute-neg-frac92.6%
neg-mul-192.6%
times-frac99.9%
distribute-lft-out--99.9%
*-commutative99.9%
associate-/r*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 62.0%
if -3.2000000000000001e95 < y < -9.5e10 or 1.5e28 < y Initial program 98.7%
Taylor expanded in z around 0 98.8%
Taylor expanded in y around inf 64.1%
associate-*r/64.1%
*-commutative64.1%
associate-*r/64.1%
Simplified64.1%
clear-num64.0%
un-div-inv64.1%
div-inv64.2%
metadata-eval64.2%
Applied egg-rr64.2%
if -7.00000000000000041e-86 < y < 1.5e28Initial program 92.5%
Taylor expanded in z around 0 92.5%
Taylor expanded in x around 0 68.0%
distribute-lft-out--68.0%
associate-/r*63.6%
div-sub64.5%
Simplified64.5%
Taylor expanded in t around inf 66.5%
*-commutative66.5%
Simplified66.5%
Final simplification67.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7e-76) (not (<= x 3.95e-50))) (+ x (* y (/ -0.3333333333333333 z))) (* 0.3333333333333333 (/ (- (/ t y) y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7e-76) || !(x <= 3.95e-50)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-7d-76)) .or. (.not. (x <= 3.95d-50))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7e-76) || !(x <= 3.95e-50)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7e-76) or not (x <= 3.95e-50): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = 0.3333333333333333 * (((t / y) - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7e-76) || !(x <= 3.95e-50)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7e-76) || ~((x <= 3.95e-50))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = 0.3333333333333333 * (((t / y) - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7e-76], N[Not[LessEqual[x, 3.95e-50]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-76} \lor \neg \left(x \leq 3.95 \cdot 10^{-50}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\end{array}
\end{array}
if x < -6.99999999999999995e-76 or 3.9500000000000001e-50 < x Initial program 95.8%
associate-+l-95.8%
sub-neg95.8%
sub-neg95.8%
distribute-neg-in95.8%
unsub-neg95.8%
neg-mul-195.8%
associate-*r/95.8%
associate-*l/95.8%
distribute-neg-frac95.8%
neg-mul-195.8%
times-frac94.6%
distribute-lft-out--95.3%
*-commutative95.3%
associate-/r*95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in y around inf 79.3%
if -6.99999999999999995e-76 < x < 3.9500000000000001e-50Initial program 95.6%
Taylor expanded in z around 0 95.6%
Taylor expanded in x around 0 92.1%
distribute-lft-out--92.1%
associate-/r*89.6%
div-sub90.5%
Simplified90.5%
Final simplification84.3%
(FPCore (x y z t)
:precision binary64
(if (<= x -9.5e-76)
(+ x (* y (* -0.3333333333333333 (/ 1.0 z))))
(if (<= x 3.1e-50)
(* 0.3333333333333333 (/ (- (/ t y) y) z))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.5e-76) {
tmp = x + (y * (-0.3333333333333333 * (1.0 / z)));
} else if (x <= 3.1e-50) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-9.5d-76)) then
tmp = x + (y * ((-0.3333333333333333d0) * (1.0d0 / z)))
else if (x <= 3.1d-50) then
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.5e-76) {
tmp = x + (y * (-0.3333333333333333 * (1.0 / z)));
} else if (x <= 3.1e-50) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9.5e-76: tmp = x + (y * (-0.3333333333333333 * (1.0 / z))) elif x <= 3.1e-50: tmp = 0.3333333333333333 * (((t / y) - y) / z) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9.5e-76) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 * Float64(1.0 / z)))); elseif (x <= 3.1e-50) tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9.5e-76) tmp = x + (y * (-0.3333333333333333 * (1.0 / z))); elseif (x <= 3.1e-50) tmp = 0.3333333333333333 * (((t / y) - y) / z); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.5e-76], N[(x + N[(y * N[(-0.3333333333333333 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1e-50], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-76}:\\
\;\;\;\;x + y \cdot \left(-0.3333333333333333 \cdot \frac{1}{z}\right)\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-50}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if x < -9.49999999999999984e-76Initial program 92.3%
associate-+l-92.3%
sub-neg92.3%
sub-neg92.3%
distribute-neg-in92.3%
unsub-neg92.3%
neg-mul-192.3%
associate-*r/92.3%
associate-*l/92.3%
distribute-neg-frac92.3%
neg-mul-192.3%
times-frac95.4%
distribute-lft-out--97.0%
*-commutative97.0%
associate-/r*96.9%
metadata-eval96.9%
Simplified96.9%
Taylor expanded in y around inf 78.4%
div-inv78.5%
Applied egg-rr78.5%
if -9.49999999999999984e-76 < x < 3.1000000000000002e-50Initial program 95.6%
Taylor expanded in z around 0 95.6%
Taylor expanded in x around 0 92.1%
distribute-lft-out--92.1%
associate-/r*89.6%
div-sub90.5%
Simplified90.5%
if 3.1000000000000002e-50 < x Initial program 98.7%
associate-+l-98.7%
sub-neg98.7%
sub-neg98.7%
distribute-neg-in98.7%
unsub-neg98.7%
neg-mul-198.7%
associate-*r/98.7%
associate-*l/98.7%
distribute-neg-frac98.7%
neg-mul-198.7%
times-frac94.0%
distribute-lft-out--94.0%
*-commutative94.0%
associate-/r*94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in y around inf 80.1%
Final simplification84.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -150000000000.0)
(+ x (* y (* -0.3333333333333333 (/ 1.0 z))))
(if (<= y 24000000000000.0)
(+ x (* (/ t y) (/ 0.3333333333333333 z)))
(+ x (/ (* y -0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -150000000000.0) {
tmp = x + (y * (-0.3333333333333333 * (1.0 / z)));
} else if (y <= 24000000000000.0) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-150000000000.0d0)) then
tmp = x + (y * ((-0.3333333333333333d0) * (1.0d0 / z)))
else if (y <= 24000000000000.0d0) then
tmp = x + ((t / y) * (0.3333333333333333d0 / z))
else
tmp = x + ((y * (-0.3333333333333333d0)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -150000000000.0) {
tmp = x + (y * (-0.3333333333333333 * (1.0 / z)));
} else if (y <= 24000000000000.0) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -150000000000.0: tmp = x + (y * (-0.3333333333333333 * (1.0 / z))) elif y <= 24000000000000.0: tmp = x + ((t / y) * (0.3333333333333333 / z)) else: tmp = x + ((y * -0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -150000000000.0) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 * Float64(1.0 / z)))); elseif (y <= 24000000000000.0) tmp = Float64(x + Float64(Float64(t / y) * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -150000000000.0) tmp = x + (y * (-0.3333333333333333 * (1.0 / z))); elseif (y <= 24000000000000.0) tmp = x + ((t / y) * (0.3333333333333333 / z)); else tmp = x + ((y * -0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -150000000000.0], N[(x + N[(y * N[(-0.3333333333333333 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 24000000000000.0], N[(x + N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -150000000000:\\
\;\;\;\;x + y \cdot \left(-0.3333333333333333 \cdot \frac{1}{z}\right)\\
\mathbf{elif}\;y \leq 24000000000000:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.5e11Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
unsub-neg99.8%
neg-mul-199.8%
associate-*r/99.8%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 92.5%
div-inv92.6%
Applied egg-rr92.6%
if -1.5e11 < y < 2.4e13Initial program 91.9%
associate-+l-91.9%
sub-neg91.9%
sub-neg91.9%
distribute-neg-in91.9%
unsub-neg91.9%
neg-mul-191.9%
associate-*r/91.9%
associate-*l/91.9%
distribute-neg-frac91.9%
neg-mul-191.9%
times-frac88.1%
distribute-lft-out--88.9%
*-commutative88.9%
associate-/r*88.9%
metadata-eval88.9%
Simplified88.9%
Taylor expanded in y around 0 89.8%
*-commutative89.8%
associate-*l/89.7%
times-frac83.7%
Simplified83.7%
if 2.4e13 < y Initial program 98.5%
associate-+l-98.5%
sub-neg98.5%
sub-neg98.5%
distribute-neg-in98.5%
unsub-neg98.5%
neg-mul-198.5%
associate-*r/98.5%
associate-*l/98.4%
distribute-neg-frac98.4%
neg-mul-198.4%
times-frac98.4%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
metadata-eval98.4%
cancel-sign-sub-inv98.4%
associate-/r*98.4%
associate-*r/98.4%
associate-*r/98.4%
div-sub99.7%
distribute-lft-out--99.7%
Simplified99.7%
Taylor expanded in t around 0 96.0%
*-commutative96.0%
Simplified96.0%
Final simplification89.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -470000000.0)
(+ x (* y (* -0.3333333333333333 (/ 1.0 z))))
(if (<= y 8.2e+18)
(+ x (/ (* t 0.3333333333333333) (* y z)))
(+ x (/ (* y -0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -470000000.0) {
tmp = x + (y * (-0.3333333333333333 * (1.0 / z)));
} else if (y <= 8.2e+18) {
tmp = x + ((t * 0.3333333333333333) / (y * z));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-470000000.0d0)) then
tmp = x + (y * ((-0.3333333333333333d0) * (1.0d0 / z)))
else if (y <= 8.2d+18) then
tmp = x + ((t * 0.3333333333333333d0) / (y * z))
else
tmp = x + ((y * (-0.3333333333333333d0)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -470000000.0) {
tmp = x + (y * (-0.3333333333333333 * (1.0 / z)));
} else if (y <= 8.2e+18) {
tmp = x + ((t * 0.3333333333333333) / (y * z));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -470000000.0: tmp = x + (y * (-0.3333333333333333 * (1.0 / z))) elif y <= 8.2e+18: tmp = x + ((t * 0.3333333333333333) / (y * z)) else: tmp = x + ((y * -0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -470000000.0) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 * Float64(1.0 / z)))); elseif (y <= 8.2e+18) tmp = Float64(x + Float64(Float64(t * 0.3333333333333333) / Float64(y * z))); else tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -470000000.0) tmp = x + (y * (-0.3333333333333333 * (1.0 / z))); elseif (y <= 8.2e+18) tmp = x + ((t * 0.3333333333333333) / (y * z)); else tmp = x + ((y * -0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -470000000.0], N[(x + N[(y * N[(-0.3333333333333333 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+18], N[(x + N[(N[(t * 0.3333333333333333), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -470000000:\\
\;\;\;\;x + y \cdot \left(-0.3333333333333333 \cdot \frac{1}{z}\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{t \cdot 0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -4.7e8Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
unsub-neg99.8%
neg-mul-199.8%
associate-*r/99.8%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 92.5%
div-inv92.6%
Applied egg-rr92.6%
if -4.7e8 < y < 8.2e18Initial program 91.9%
associate-+l-91.9%
sub-neg91.9%
sub-neg91.9%
distribute-neg-in91.9%
unsub-neg91.9%
neg-mul-191.9%
associate-*r/91.9%
associate-*l/91.9%
distribute-neg-frac91.9%
neg-mul-191.9%
times-frac88.1%
distribute-lft-out--88.9%
*-commutative88.9%
associate-/r*88.9%
metadata-eval88.9%
Simplified88.9%
Taylor expanded in y around 0 89.8%
*-commutative89.8%
associate-*l/89.7%
times-frac83.7%
Simplified83.7%
frac-times89.7%
Applied egg-rr89.7%
if 8.2e18 < y Initial program 98.5%
associate-+l-98.5%
sub-neg98.5%
sub-neg98.5%
distribute-neg-in98.5%
unsub-neg98.5%
neg-mul-198.5%
associate-*r/98.5%
associate-*l/98.4%
distribute-neg-frac98.4%
neg-mul-198.4%
times-frac98.4%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
metadata-eval98.4%
cancel-sign-sub-inv98.4%
associate-/r*98.4%
associate-*r/98.4%
associate-*r/98.4%
div-sub99.7%
distribute-lft-out--99.7%
Simplified99.7%
Taylor expanded in t around 0 96.0%
*-commutative96.0%
Simplified96.0%
Final simplification92.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -260000000.0)
(+ x (* y (* -0.3333333333333333 (/ 1.0 z))))
(if (<= y 26500000000000.0)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(+ x (/ (* y -0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -260000000.0) {
tmp = x + (y * (-0.3333333333333333 * (1.0 / z)));
} else if (y <= 26500000000000.0) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-260000000.0d0)) then
tmp = x + (y * ((-0.3333333333333333d0) * (1.0d0 / z)))
else if (y <= 26500000000000.0d0) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x + ((y * (-0.3333333333333333d0)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -260000000.0) {
tmp = x + (y * (-0.3333333333333333 * (1.0 / z)));
} else if (y <= 26500000000000.0) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -260000000.0: tmp = x + (y * (-0.3333333333333333 * (1.0 / z))) elif y <= 26500000000000.0: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x + ((y * -0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -260000000.0) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 * Float64(1.0 / z)))); elseif (y <= 26500000000000.0) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -260000000.0) tmp = x + (y * (-0.3333333333333333 * (1.0 / z))); elseif (y <= 26500000000000.0) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x + ((y * -0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -260000000.0], N[(x + N[(y * N[(-0.3333333333333333 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 26500000000000.0], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -260000000:\\
\;\;\;\;x + y \cdot \left(-0.3333333333333333 \cdot \frac{1}{z}\right)\\
\mathbf{elif}\;y \leq 26500000000000:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -2.6e8Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
unsub-neg99.8%
neg-mul-199.8%
associate-*r/99.8%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 92.5%
div-inv92.6%
Applied egg-rr92.6%
if -2.6e8 < y < 2.65e13Initial program 91.9%
associate-+l-91.9%
sub-neg91.9%
sub-neg91.9%
distribute-neg-in91.9%
unsub-neg91.9%
neg-mul-191.9%
associate-*r/91.9%
associate-*l/91.9%
distribute-neg-frac91.9%
neg-mul-191.9%
times-frac88.1%
distribute-lft-out--88.9%
*-commutative88.9%
associate-/r*88.9%
metadata-eval88.9%
Simplified88.9%
Taylor expanded in y around 0 89.8%
if 2.65e13 < y Initial program 98.5%
associate-+l-98.5%
sub-neg98.5%
sub-neg98.5%
distribute-neg-in98.5%
unsub-neg98.5%
neg-mul-198.5%
associate-*r/98.5%
associate-*l/98.4%
distribute-neg-frac98.4%
neg-mul-198.4%
times-frac98.4%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
metadata-eval98.4%
cancel-sign-sub-inv98.4%
associate-/r*98.4%
associate-*r/98.4%
associate-*r/98.4%
div-sub99.7%
distribute-lft-out--99.7%
Simplified99.7%
Taylor expanded in t around 0 96.0%
*-commutative96.0%
Simplified96.0%
Final simplification92.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -5500000000.0)
(+ x (* y (* -0.3333333333333333 (/ 1.0 z))))
(if (<= y 1.4e+23)
(+ x (/ t (* 3.0 (* y z))))
(+ x (/ (* y -0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5500000000.0) {
tmp = x + (y * (-0.3333333333333333 * (1.0 / z)));
} else if (y <= 1.4e+23) {
tmp = x + (t / (3.0 * (y * z)));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5500000000.0d0)) then
tmp = x + (y * ((-0.3333333333333333d0) * (1.0d0 / z)))
else if (y <= 1.4d+23) then
tmp = x + (t / (3.0d0 * (y * z)))
else
tmp = x + ((y * (-0.3333333333333333d0)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5500000000.0) {
tmp = x + (y * (-0.3333333333333333 * (1.0 / z)));
} else if (y <= 1.4e+23) {
tmp = x + (t / (3.0 * (y * z)));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5500000000.0: tmp = x + (y * (-0.3333333333333333 * (1.0 / z))) elif y <= 1.4e+23: tmp = x + (t / (3.0 * (y * z))) else: tmp = x + ((y * -0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5500000000.0) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 * Float64(1.0 / z)))); elseif (y <= 1.4e+23) tmp = Float64(x + Float64(t / Float64(3.0 * Float64(y * z)))); else tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5500000000.0) tmp = x + (y * (-0.3333333333333333 * (1.0 / z))); elseif (y <= 1.4e+23) tmp = x + (t / (3.0 * (y * z))); else tmp = x + ((y * -0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5500000000.0], N[(x + N[(y * N[(-0.3333333333333333 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+23], N[(x + N[(t / N[(3.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5500000000:\\
\;\;\;\;x + y \cdot \left(-0.3333333333333333 \cdot \frac{1}{z}\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{t}{3 \cdot \left(y \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -5.5e9Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
unsub-neg99.8%
neg-mul-199.8%
associate-*r/99.8%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 92.5%
div-inv92.6%
Applied egg-rr92.6%
if -5.5e9 < y < 1.4e23Initial program 91.9%
associate-+l-91.9%
sub-neg91.9%
sub-neg91.9%
distribute-neg-in91.9%
unsub-neg91.9%
neg-mul-191.9%
associate-*r/91.9%
associate-*l/91.9%
distribute-neg-frac91.9%
neg-mul-191.9%
times-frac88.1%
distribute-lft-out--88.9%
*-commutative88.9%
associate-/r*88.9%
metadata-eval88.9%
Simplified88.9%
Taylor expanded in y around 0 89.8%
associate-*r/89.7%
*-commutative89.7%
associate-/l*89.7%
div-inv89.8%
*-commutative89.8%
metadata-eval89.8%
Applied egg-rr89.8%
if 1.4e23 < y Initial program 98.5%
associate-+l-98.5%
sub-neg98.5%
sub-neg98.5%
distribute-neg-in98.5%
unsub-neg98.5%
neg-mul-198.5%
associate-*r/98.5%
associate-*l/98.4%
distribute-neg-frac98.4%
neg-mul-198.4%
times-frac98.4%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 98.4%
+-commutative98.4%
metadata-eval98.4%
cancel-sign-sub-inv98.4%
associate-/r*98.4%
associate-*r/98.4%
associate-*r/98.4%
div-sub99.7%
distribute-lft-out--99.7%
Simplified99.7%
Taylor expanded in t around 0 96.0%
*-commutative96.0%
Simplified96.0%
Final simplification92.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9.8e-92) (not (<= y 2e-120))) (+ x (* y (/ -0.3333333333333333 z))) (* 0.3333333333333333 (/ t (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.8e-92) || !(y <= 2e-120)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (t / (y * z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-9.8d-92)) .or. (.not. (y <= 2d-120))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = 0.3333333333333333d0 * (t / (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.8e-92) || !(y <= 2e-120)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (t / (y * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9.8e-92) or not (y <= 2e-120): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = 0.3333333333333333 * (t / (y * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9.8e-92) || !(y <= 2e-120)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9.8e-92) || ~((y <= 2e-120))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = 0.3333333333333333 * (t / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9.8e-92], N[Not[LessEqual[y, 2e-120]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.8 \cdot 10^{-92} \lor \neg \left(y \leq 2 \cdot 10^{-120}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\end{array}
\end{array}
if y < -9.8e-92 or 1.99999999999999996e-120 < y Initial program 97.0%
associate-+l-97.0%
sub-neg97.0%
sub-neg97.0%
distribute-neg-in97.0%
unsub-neg97.0%
neg-mul-197.0%
associate-*r/97.0%
associate-*l/97.0%
distribute-neg-frac97.0%
neg-mul-197.0%
times-frac98.0%
distribute-lft-out--99.2%
*-commutative99.2%
associate-/r*99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around inf 87.0%
if -9.8e-92 < y < 1.99999999999999996e-120Initial program 92.7%
Taylor expanded in z around 0 92.8%
Taylor expanded in x around 0 73.3%
distribute-lft-out--73.3%
associate-/r*67.6%
div-sub67.6%
Simplified67.6%
Taylor expanded in t around inf 73.3%
*-commutative73.3%
Simplified73.3%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.62e-96) (not (<= y 2.75e-120))) (+ x (/ (* y -0.3333333333333333) z)) (* 0.3333333333333333 (/ t (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.62e-96) || !(y <= 2.75e-120)) {
tmp = x + ((y * -0.3333333333333333) / z);
} else {
tmp = 0.3333333333333333 * (t / (y * z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.62d-96)) .or. (.not. (y <= 2.75d-120))) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else
tmp = 0.3333333333333333d0 * (t / (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.62e-96) || !(y <= 2.75e-120)) {
tmp = x + ((y * -0.3333333333333333) / z);
} else {
tmp = 0.3333333333333333 * (t / (y * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.62e-96) or not (y <= 2.75e-120): tmp = x + ((y * -0.3333333333333333) / z) else: tmp = 0.3333333333333333 * (t / (y * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.62e-96) || !(y <= 2.75e-120)) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); else tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.62e-96) || ~((y <= 2.75e-120))) tmp = x + ((y * -0.3333333333333333) / z); else tmp = 0.3333333333333333 * (t / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.62e-96], N[Not[LessEqual[y, 2.75e-120]], $MachinePrecision]], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{-96} \lor \neg \left(y \leq 2.75 \cdot 10^{-120}\right):\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\end{array}
\end{array}
if y < -1.62000000000000001e-96 or 2.7500000000000001e-120 < y Initial program 97.0%
associate-+l-97.0%
sub-neg97.0%
sub-neg97.0%
distribute-neg-in97.0%
unsub-neg97.0%
neg-mul-197.0%
associate-*r/97.0%
associate-*l/97.0%
distribute-neg-frac97.0%
neg-mul-197.0%
times-frac98.0%
distribute-lft-out--99.2%
*-commutative99.2%
associate-/r*99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around 0 96.9%
+-commutative96.9%
metadata-eval96.9%
cancel-sign-sub-inv96.9%
associate-/r*98.0%
associate-*r/98.0%
associate-*r/98.0%
div-sub99.2%
distribute-lft-out--99.2%
Simplified99.2%
Taylor expanded in t around 0 87.0%
*-commutative87.0%
Simplified87.0%
if -1.62000000000000001e-96 < y < 2.7500000000000001e-120Initial program 92.7%
Taylor expanded in z around 0 92.8%
Taylor expanded in x around 0 73.3%
distribute-lft-out--73.3%
associate-/r*67.6%
div-sub67.6%
Simplified67.6%
Taylor expanded in t around inf 73.3%
*-commutative73.3%
Simplified73.3%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (+ x (* (/ -0.3333333333333333 z) (- y (/ t y)))))
double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 / z) * (y - (t / 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 - (t / y)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 / z) * (y - (t / y)));
}
def code(x, y, z, t): return x + ((-0.3333333333333333 / z) * (y - (t / y)))
function code(x, y, z, t) return Float64(x + Float64(Float64(-0.3333333333333333 / z) * Float64(y - Float64(t / y)))) end
function tmp = code(x, y, z, t) tmp = x + ((-0.3333333333333333 / z) * (y - (t / y))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 / z), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)
\end{array}
Initial program 95.7%
associate-+l-95.7%
sub-neg95.7%
sub-neg95.7%
distribute-neg-in95.7%
unsub-neg95.7%
neg-mul-195.7%
associate-*r/95.7%
associate-*l/95.6%
distribute-neg-frac95.6%
neg-mul-195.6%
times-frac93.9%
distribute-lft-out--94.7%
*-commutative94.7%
associate-/r*94.6%
metadata-eval94.6%
Simplified94.6%
Final simplification94.6%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (/ z 0.3333333333333333))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z / 0.3333333333333333));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (((t / y) - y) / (z / 0.3333333333333333d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z / 0.3333333333333333));
}
def code(x, y, z, t): return x + (((t / y) - y) / (z / 0.3333333333333333))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z / 0.3333333333333333))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) / (z / 0.3333333333333333)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z / 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{t}{y} - y}{\frac{z}{0.3333333333333333}}
\end{array}
Initial program 95.7%
associate-+l-95.7%
sub-neg95.7%
sub-neg95.7%
distribute-neg-in95.7%
unsub-neg95.7%
neg-mul-195.7%
associate-*r/95.7%
associate-*l/95.6%
distribute-neg-frac95.6%
neg-mul-195.6%
times-frac93.9%
distribute-lft-out--94.7%
*-commutative94.7%
associate-/r*94.6%
metadata-eval94.6%
Simplified94.6%
Taylor expanded in y around 0 95.6%
+-commutative95.6%
metadata-eval95.6%
cancel-sign-sub-inv95.6%
associate-/r*93.9%
associate-*r/93.8%
associate-*r/93.8%
div-sub94.6%
distribute-lft-out--94.6%
Simplified94.6%
div-inv94.6%
Applied egg-rr94.6%
un-div-inv94.6%
*-commutative94.6%
associate-/l*94.7%
Applied egg-rr94.7%
Final simplification94.7%
(FPCore (x y z t) :precision binary64 (if (<= x -7.8e-77) x (if (<= x 5.1e+100) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.8e-77) {
tmp = x;
} else if (x <= 5.1e+100) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-7.8d-77)) then
tmp = x
else if (x <= 5.1d+100) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.8e-77) {
tmp = x;
} else if (x <= 5.1e+100) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -7.8e-77: tmp = x elif x <= 5.1e+100: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -7.8e-77) tmp = x; elseif (x <= 5.1e+100) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -7.8e-77) tmp = x; elseif (x <= 5.1e+100) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -7.8e-77], x, If[LessEqual[x, 5.1e+100], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{-77}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{+100}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.79999999999999958e-77 or 5.1000000000000001e100 < x Initial program 94.6%
associate-+l-94.6%
sub-neg94.6%
sub-neg94.6%
distribute-neg-in94.6%
unsub-neg94.6%
neg-mul-194.6%
associate-*r/94.6%
associate-*l/94.6%
distribute-neg-frac94.6%
neg-mul-194.6%
times-frac94.8%
distribute-lft-out--95.7%
*-commutative95.7%
associate-/r*95.7%
metadata-eval95.7%
Simplified95.7%
Taylor expanded in x around inf 57.3%
if -7.79999999999999958e-77 < x < 5.1000000000000001e100Initial program 96.5%
Taylor expanded in z around 0 96.5%
Taylor expanded in y around inf 49.4%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (if (<= x -5.8e-77) x (if (<= x 2.2e+100) (/ y (* z -3.0)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.8e-77) {
tmp = x;
} else if (x <= 2.2e+100) {
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 (x <= (-5.8d-77)) then
tmp = x
else if (x <= 2.2d+100) 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 (x <= -5.8e-77) {
tmp = x;
} else if (x <= 2.2e+100) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.8e-77: tmp = x elif x <= 2.2e+100: tmp = y / (z * -3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.8e-77) tmp = x; elseif (x <= 2.2e+100) 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 (x <= -5.8e-77) tmp = x; elseif (x <= 2.2e+100) tmp = y / (z * -3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.8e-77], x, If[LessEqual[x, 2.2e+100], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-77}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+100}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.7999999999999997e-77 or 2.2000000000000001e100 < x Initial program 94.6%
associate-+l-94.6%
sub-neg94.6%
sub-neg94.6%
distribute-neg-in94.6%
unsub-neg94.6%
neg-mul-194.6%
associate-*r/94.6%
associate-*l/94.6%
distribute-neg-frac94.6%
neg-mul-194.6%
times-frac94.8%
distribute-lft-out--95.7%
*-commutative95.7%
associate-/r*95.7%
metadata-eval95.7%
Simplified95.7%
Taylor expanded in x around inf 57.3%
if -5.7999999999999997e-77 < x < 2.2000000000000001e100Initial program 96.5%
Taylor expanded in z around 0 96.5%
Taylor expanded in y around inf 49.4%
associate-*r/49.4%
*-commutative49.4%
associate-*r/49.3%
Simplified49.3%
clear-num49.4%
un-div-inv49.4%
div-inv49.4%
metadata-eval49.4%
Applied egg-rr49.4%
Final simplification52.8%
(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 95.7%
associate-+l-95.7%
sub-neg95.7%
sub-neg95.7%
distribute-neg-in95.7%
unsub-neg95.7%
neg-mul-195.7%
associate-*r/95.7%
associate-*l/95.6%
distribute-neg-frac95.6%
neg-mul-195.6%
times-frac93.9%
distribute-lft-out--94.7%
*-commutative94.7%
associate-/r*94.6%
metadata-eval94.6%
Simplified94.6%
Taylor expanded in x around inf 29.9%
Final simplification29.9%
(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 2023196
(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))))