
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= t -9e-97) (+ (+ (/ t (* z (* y 3.0))) x) (/ y (* z -3.0))) (+ x (* (/ -0.3333333333333333 z) (- y (/ t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9e-97) {
tmp = ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0));
} else {
tmp = x + ((-0.3333333333333333 / z) * (y - (t / 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 (t <= (-9d-97)) then
tmp = ((t / (z * (y * 3.0d0))) + x) + (y / (z * (-3.0d0)))
else
tmp = x + (((-0.3333333333333333d0) / z) * (y - (t / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9e-97) {
tmp = ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0));
} else {
tmp = x + ((-0.3333333333333333 / z) * (y - (t / y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -9e-97: tmp = ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0)) else: tmp = x + ((-0.3333333333333333 / z) * (y - (t / y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -9e-97) tmp = Float64(Float64(Float64(t / Float64(z * Float64(y * 3.0))) + x) + Float64(y / Float64(z * -3.0))); else tmp = Float64(x + Float64(Float64(-0.3333333333333333 / z) * Float64(y - Float64(t / y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -9e-97) tmp = ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0)); else tmp = x + ((-0.3333333333333333 / z) * (y - (t / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -9e-97], N[(N[(N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.3333333333333333 / z), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{-97}:\\
\;\;\;\;\left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)\\
\end{array}
\end{array}
if t < -9.0000000000000002e-97Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
sub-neg99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-frac-neg299.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
if -9.0000000000000002e-97 < t Initial program 92.2%
sub-neg92.2%
associate-+l+92.2%
remove-double-neg92.2%
distribute-frac-neg92.2%
sub-neg92.2%
distribute-frac-neg92.2%
neg-mul-192.2%
*-commutative92.2%
associate-/l*92.2%
*-commutative92.2%
neg-mul-192.2%
times-frac96.2%
distribute-lft-out--98.0%
*-commutative98.0%
associate-/r*98.1%
metadata-eval98.1%
Simplified98.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.3e+114)
(* -0.3333333333333333 (/ y z))
(if (<= y -1.9e+17)
x
(if (<= y 1.2e-157)
(* 0.3333333333333333 (/ (/ t z) y))
(if (<= y 5.5e+34) x (/ (* y -0.3333333333333333) z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e+114) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= -1.9e+17) {
tmp = x;
} else if (y <= 1.2e-157) {
tmp = 0.3333333333333333 * ((t / z) / y);
} else if (y <= 5.5e+34) {
tmp = x;
} else {
tmp = (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 <= (-1.3d+114)) then
tmp = (-0.3333333333333333d0) * (y / z)
else if (y <= (-1.9d+17)) then
tmp = x
else if (y <= 1.2d-157) then
tmp = 0.3333333333333333d0 * ((t / z) / y)
else if (y <= 5.5d+34) then
tmp = x
else
tmp = (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 <= -1.3e+114) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= -1.9e+17) {
tmp = x;
} else if (y <= 1.2e-157) {
tmp = 0.3333333333333333 * ((t / z) / y);
} else if (y <= 5.5e+34) {
tmp = x;
} else {
tmp = (y * -0.3333333333333333) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.3e+114: tmp = -0.3333333333333333 * (y / z) elif y <= -1.9e+17: tmp = x elif y <= 1.2e-157: tmp = 0.3333333333333333 * ((t / z) / y) elif y <= 5.5e+34: tmp = x else: tmp = (y * -0.3333333333333333) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.3e+114) tmp = Float64(-0.3333333333333333 * Float64(y / z)); elseif (y <= -1.9e+17) tmp = x; elseif (y <= 1.2e-157) tmp = Float64(0.3333333333333333 * Float64(Float64(t / z) / y)); elseif (y <= 5.5e+34) tmp = x; else tmp = Float64(Float64(y * -0.3333333333333333) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.3e+114) tmp = -0.3333333333333333 * (y / z); elseif (y <= -1.9e+17) tmp = x; elseif (y <= 1.2e-157) tmp = 0.3333333333333333 * ((t / z) / y); elseif (y <= 5.5e+34) tmp = x; else tmp = (y * -0.3333333333333333) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.3e+114], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.9e+17], x, If[LessEqual[y, 1.2e-157], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+34], x, N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+114}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{+17}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-157}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.3e114Initial program 97.3%
Taylor expanded in z around 0 80.9%
Taylor expanded in t around 0 78.8%
if -1.3e114 < y < -1.9e17 or 1.2e-157 < y < 5.4999999999999996e34Initial program 96.7%
sub-neg96.7%
associate-+l+96.7%
distribute-frac-neg96.7%
neg-mul-196.7%
*-commutative96.7%
times-frac96.6%
fma-define96.6%
metadata-eval96.6%
associate-*l*96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in x around inf 54.2%
if -1.9e17 < y < 1.2e-157Initial program 90.5%
sub-neg90.5%
associate-+l+90.5%
remove-double-neg90.5%
distribute-frac-neg90.5%
sub-neg90.5%
distribute-frac-neg90.5%
neg-mul-190.5%
*-commutative90.5%
associate-/l*90.5%
*-commutative90.5%
neg-mul-190.5%
times-frac91.4%
distribute-lft-out--91.4%
*-commutative91.4%
associate-/r*91.4%
metadata-eval91.4%
Simplified91.4%
Taylor expanded in y around 0 88.3%
Taylor expanded in x around 0 64.2%
associate-*r/64.2%
*-commutative64.2%
associate-/r*68.3%
associate-*r/68.3%
Simplified68.3%
associate-/l*68.3%
Applied egg-rr68.3%
if 5.4999999999999996e34 < y Initial program 97.9%
Taylor expanded in z around 0 79.7%
Taylor expanded in t around 0 75.5%
associate-*r/75.5%
Simplified75.5%
Final simplification67.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.5e+114)
(* -0.3333333333333333 (/ y z))
(if (<= y -1.9e+17)
x
(if (<= y 6e-161)
(* 0.3333333333333333 (/ t (* z y)))
(if (<= y 9e+35) x (/ (* y -0.3333333333333333) z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.5e+114) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= -1.9e+17) {
tmp = x;
} else if (y <= 6e-161) {
tmp = 0.3333333333333333 * (t / (z * y));
} else if (y <= 9e+35) {
tmp = x;
} else {
tmp = (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 <= (-1.5d+114)) then
tmp = (-0.3333333333333333d0) * (y / z)
else if (y <= (-1.9d+17)) then
tmp = x
else if (y <= 6d-161) then
tmp = 0.3333333333333333d0 * (t / (z * y))
else if (y <= 9d+35) then
tmp = x
else
tmp = (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 <= -1.5e+114) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= -1.9e+17) {
tmp = x;
} else if (y <= 6e-161) {
tmp = 0.3333333333333333 * (t / (z * y));
} else if (y <= 9e+35) {
tmp = x;
} else {
tmp = (y * -0.3333333333333333) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.5e+114: tmp = -0.3333333333333333 * (y / z) elif y <= -1.9e+17: tmp = x elif y <= 6e-161: tmp = 0.3333333333333333 * (t / (z * y)) elif y <= 9e+35: tmp = x else: tmp = (y * -0.3333333333333333) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.5e+114) tmp = Float64(-0.3333333333333333 * Float64(y / z)); elseif (y <= -1.9e+17) tmp = x; elseif (y <= 6e-161) tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); elseif (y <= 9e+35) tmp = x; else tmp = Float64(Float64(y * -0.3333333333333333) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.5e+114) tmp = -0.3333333333333333 * (y / z); elseif (y <= -1.9e+17) tmp = x; elseif (y <= 6e-161) tmp = 0.3333333333333333 * (t / (z * y)); elseif (y <= 9e+35) tmp = x; else tmp = (y * -0.3333333333333333) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.5e+114], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.9e+17], x, If[LessEqual[y, 6e-161], N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+35], x, N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+114}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{+17}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-161}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+35}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.5e114Initial program 97.3%
Taylor expanded in z around 0 80.9%
Taylor expanded in t around 0 78.8%
if -1.5e114 < y < -1.9e17 or 5.99999999999999977e-161 < y < 8.9999999999999993e35Initial program 96.7%
sub-neg96.7%
associate-+l+96.7%
distribute-frac-neg96.7%
neg-mul-196.7%
*-commutative96.7%
times-frac96.6%
fma-define96.6%
metadata-eval96.6%
associate-*l*96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in x around inf 54.2%
if -1.9e17 < y < 5.99999999999999977e-161Initial program 90.5%
sub-neg90.5%
associate-+l+90.5%
remove-double-neg90.5%
distribute-frac-neg90.5%
sub-neg90.5%
distribute-frac-neg90.5%
neg-mul-190.5%
*-commutative90.5%
associate-/l*90.5%
*-commutative90.5%
neg-mul-190.5%
times-frac91.4%
distribute-lft-out--91.4%
*-commutative91.4%
associate-/r*91.4%
metadata-eval91.4%
Simplified91.4%
Taylor expanded in y around 0 88.3%
Taylor expanded in x around 0 64.2%
if 8.9999999999999993e35 < y Initial program 97.9%
Taylor expanded in z around 0 79.7%
Taylor expanded in t around 0 75.5%
associate-*r/75.5%
Simplified75.5%
Final simplification66.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -700000000000.0)
(+ x (/ (/ y z) -3.0))
(if (<= y 28000000000000.0)
(+ x (/ (/ t 3.0) (* z y)))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -700000000000.0) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 28000000000000.0) {
tmp = x + ((t / 3.0) / (z * y));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 <= (-700000000000.0d0)) then
tmp = x + ((y / z) / (-3.0d0))
else if (y <= 28000000000000.0d0) then
tmp = x + ((t / 3.0d0) / (z * y))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -700000000000.0) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 28000000000000.0) {
tmp = x + ((t / 3.0) / (z * y));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -700000000000.0: tmp = x + ((y / z) / -3.0) elif y <= 28000000000000.0: tmp = x + ((t / 3.0) / (z * y)) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -700000000000.0) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); elseif (y <= 28000000000000.0) tmp = Float64(x + Float64(Float64(t / 3.0) / Float64(z * y))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -700000000000.0) tmp = x + ((y / z) / -3.0); elseif (y <= 28000000000000.0) tmp = x + ((t / 3.0) / (z * y)); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -700000000000.0], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 28000000000000.0], N[(x + N[(N[(t / 3.0), $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -700000000000:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{elif}\;y \leq 28000000000000:\\
\;\;\;\;x + \frac{\frac{t}{3}}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -7e11Initial program 96.7%
sub-neg96.7%
associate-+l+96.7%
remove-double-neg96.7%
distribute-frac-neg96.7%
sub-neg96.7%
distribute-frac-neg96.7%
neg-mul-196.7%
*-commutative96.7%
associate-/l*96.5%
*-commutative96.5%
neg-mul-196.5%
times-frac96.5%
distribute-lft-out--99.6%
*-commutative99.6%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 92.5%
*-commutative92.5%
metadata-eval92.5%
times-frac92.4%
*-rgt-identity92.4%
Simplified92.4%
*-un-lft-identity92.4%
times-frac92.4%
Applied egg-rr92.4%
associate-*r/92.5%
associate-*l/92.6%
*-un-lft-identity92.6%
Applied egg-rr92.6%
if -7e11 < y < 2.8e13Initial program 92.6%
sub-neg92.6%
associate-+l+92.6%
remove-double-neg92.6%
distribute-frac-neg92.6%
sub-neg92.6%
distribute-frac-neg92.6%
neg-mul-192.6%
*-commutative92.6%
associate-/l*92.6%
*-commutative92.6%
neg-mul-192.6%
times-frac93.4%
distribute-lft-out--93.4%
*-commutative93.4%
associate-/r*93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in y around 0 88.2%
metadata-eval88.2%
times-frac88.3%
*-commutative88.3%
times-frac87.6%
associate-*l/88.3%
*-lft-identity88.3%
Simplified88.3%
if 2.8e13 < y Initial program 98.0%
Taylor expanded in t around 0 95.8%
Final simplification91.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -150000000000.0)
(+ x (/ (/ y z) -3.0))
(if (<= y 1.86e+14)
(+ x (/ 0.3333333333333333 (/ (* z y) t)))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -150000000000.0) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 1.86e+14) {
tmp = x + (0.3333333333333333 / ((z * y) / t));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 / z) / (-3.0d0))
else if (y <= 1.86d+14) then
tmp = x + (0.3333333333333333d0 / ((z * y) / t))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
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 / z) / -3.0);
} else if (y <= 1.86e+14) {
tmp = x + (0.3333333333333333 / ((z * y) / t));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -150000000000.0: tmp = x + ((y / z) / -3.0) elif y <= 1.86e+14: tmp = x + (0.3333333333333333 / ((z * y) / t)) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -150000000000.0) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); elseif (y <= 1.86e+14) tmp = Float64(x + Float64(0.3333333333333333 / Float64(Float64(z * y) / t))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -150000000000.0) tmp = x + ((y / z) / -3.0); elseif (y <= 1.86e+14) tmp = x + (0.3333333333333333 / ((z * y) / t)); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -150000000000.0], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.86e+14], N[(x + N[(0.3333333333333333 / N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -150000000000:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{elif}\;y \leq 1.86 \cdot 10^{+14}:\\
\;\;\;\;x + \frac{0.3333333333333333}{\frac{z \cdot y}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -1.5e11Initial program 96.7%
sub-neg96.7%
associate-+l+96.7%
remove-double-neg96.7%
distribute-frac-neg96.7%
sub-neg96.7%
distribute-frac-neg96.7%
neg-mul-196.7%
*-commutative96.7%
associate-/l*96.5%
*-commutative96.5%
neg-mul-196.5%
times-frac96.5%
distribute-lft-out--99.6%
*-commutative99.6%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 92.5%
*-commutative92.5%
metadata-eval92.5%
times-frac92.4%
*-rgt-identity92.4%
Simplified92.4%
*-un-lft-identity92.4%
times-frac92.4%
Applied egg-rr92.4%
associate-*r/92.5%
associate-*l/92.6%
*-un-lft-identity92.6%
Applied egg-rr92.6%
if -1.5e11 < y < 1.86e14Initial program 92.6%
sub-neg92.6%
associate-+l+92.6%
remove-double-neg92.6%
distribute-frac-neg92.6%
sub-neg92.6%
distribute-frac-neg92.6%
neg-mul-192.6%
*-commutative92.6%
associate-/l*92.6%
*-commutative92.6%
neg-mul-192.6%
times-frac93.4%
distribute-lft-out--93.4%
*-commutative93.4%
associate-/r*93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in y around 0 88.2%
clear-num88.2%
un-div-inv88.3%
*-commutative88.3%
Applied egg-rr88.3%
if 1.86e14 < y Initial program 98.0%
Taylor expanded in t around 0 95.8%
Final simplification91.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -28000000000.0)
(+ x (/ (/ y z) -3.0))
(if (<= y 36000000000000.0)
(+ x (* 0.3333333333333333 (/ t (* z y))))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -28000000000.0) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 36000000000000.0) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 <= (-28000000000.0d0)) then
tmp = x + ((y / z) / (-3.0d0))
else if (y <= 36000000000000.0d0) then
tmp = x + (0.3333333333333333d0 * (t / (z * y)))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -28000000000.0) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 36000000000000.0) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -28000000000.0: tmp = x + ((y / z) / -3.0) elif y <= 36000000000000.0: tmp = x + (0.3333333333333333 * (t / (z * y))) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -28000000000.0) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); elseif (y <= 36000000000000.0) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(z * y)))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -28000000000.0) tmp = x + ((y / z) / -3.0); elseif (y <= 36000000000000.0) tmp = x + (0.3333333333333333 * (t / (z * y))); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -28000000000.0], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 36000000000000.0], N[(x + N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -28000000000:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{elif}\;y \leq 36000000000000:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -2.8e10Initial program 96.7%
sub-neg96.7%
associate-+l+96.7%
remove-double-neg96.7%
distribute-frac-neg96.7%
sub-neg96.7%
distribute-frac-neg96.7%
neg-mul-196.7%
*-commutative96.7%
associate-/l*96.5%
*-commutative96.5%
neg-mul-196.5%
times-frac96.5%
distribute-lft-out--99.6%
*-commutative99.6%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 92.5%
*-commutative92.5%
metadata-eval92.5%
times-frac92.4%
*-rgt-identity92.4%
Simplified92.4%
*-un-lft-identity92.4%
times-frac92.4%
Applied egg-rr92.4%
associate-*r/92.5%
associate-*l/92.6%
*-un-lft-identity92.6%
Applied egg-rr92.6%
if -2.8e10 < y < 3.6e13Initial program 92.6%
sub-neg92.6%
associate-+l+92.6%
remove-double-neg92.6%
distribute-frac-neg92.6%
sub-neg92.6%
distribute-frac-neg92.6%
neg-mul-192.6%
*-commutative92.6%
associate-/l*92.6%
*-commutative92.6%
neg-mul-192.6%
times-frac93.4%
distribute-lft-out--93.4%
*-commutative93.4%
associate-/r*93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in y around 0 88.2%
if 3.6e13 < y Initial program 98.0%
Taylor expanded in t around 0 95.8%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2e-71) (not (<= y 5.4e-156))) (+ x (/ y (* z -3.0))) (* 0.3333333333333333 (/ (/ t z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2e-71) || !(y <= 5.4e-156)) {
tmp = x + (y / (z * -3.0));
} else {
tmp = 0.3333333333333333 * ((t / z) / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2d-71)) .or. (.not. (y <= 5.4d-156))) then
tmp = x + (y / (z * (-3.0d0)))
else
tmp = 0.3333333333333333d0 * ((t / z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2e-71) || !(y <= 5.4e-156)) {
tmp = x + (y / (z * -3.0));
} else {
tmp = 0.3333333333333333 * ((t / z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2e-71) or not (y <= 5.4e-156): tmp = x + (y / (z * -3.0)) else: tmp = 0.3333333333333333 * ((t / z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2e-71) || !(y <= 5.4e-156)) tmp = Float64(x + Float64(y / Float64(z * -3.0))); else tmp = Float64(0.3333333333333333 * Float64(Float64(t / z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2e-71) || ~((y <= 5.4e-156))) tmp = x + (y / (z * -3.0)); else tmp = 0.3333333333333333 * ((t / z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2e-71], N[Not[LessEqual[y, 5.4e-156]], $MachinePrecision]], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-71} \lor \neg \left(y \leq 5.4 \cdot 10^{-156}\right):\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\end{array}
\end{array}
if y < -1.9999999999999998e-71 or 5.40000000000000024e-156 < y Initial program 97.6%
sub-neg97.6%
associate-+l+97.6%
remove-double-neg97.6%
distribute-frac-neg97.6%
sub-neg97.6%
distribute-frac-neg97.6%
neg-mul-197.6%
*-commutative97.6%
associate-/l*97.5%
*-commutative97.5%
neg-mul-197.5%
times-frac97.6%
distribute-lft-out--99.2%
*-commutative99.2%
associate-/r*99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around inf 81.8%
*-commutative81.8%
metadata-eval81.8%
times-frac81.8%
*-rgt-identity81.8%
Simplified81.8%
if -1.9999999999999998e-71 < y < 5.40000000000000024e-156Initial program 87.6%
sub-neg87.6%
associate-+l+87.6%
remove-double-neg87.6%
distribute-frac-neg87.6%
sub-neg87.6%
distribute-frac-neg87.6%
neg-mul-187.6%
*-commutative87.6%
associate-/l*87.6%
*-commutative87.6%
neg-mul-187.6%
times-frac88.8%
distribute-lft-out--88.8%
*-commutative88.8%
associate-/r*88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in y around 0 86.2%
Taylor expanded in x around 0 68.6%
associate-*r/68.6%
*-commutative68.6%
associate-/r*74.0%
associate-*r/74.1%
Simplified74.1%
associate-/l*74.0%
Applied egg-rr74.0%
Final simplification79.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.5e-71)
(+ x (/ (/ y z) -3.0))
(if (<= y 5.4e-156)
(/ (* 0.3333333333333333 (/ t z)) y)
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-71) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 5.4e-156) {
tmp = (0.3333333333333333 * (t / z)) / y;
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.5d-71)) then
tmp = x + ((y / z) / (-3.0d0))
else if (y <= 5.4d-156) then
tmp = (0.3333333333333333d0 * (t / z)) / y
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-71) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 5.4e-156) {
tmp = (0.3333333333333333 * (t / z)) / y;
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e-71: tmp = x + ((y / z) / -3.0) elif y <= 5.4e-156: tmp = (0.3333333333333333 * (t / z)) / y else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e-71) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); elseif (y <= 5.4e-156) tmp = Float64(Float64(0.3333333333333333 * Float64(t / z)) / y); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e-71) tmp = x + ((y / z) / -3.0); elseif (y <= 5.4e-156) tmp = (0.3333333333333333 * (t / z)) / y; else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e-71], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e-156], N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-71}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-156}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -3.4999999999999999e-71Initial program 97.4%
sub-neg97.4%
associate-+l+97.4%
remove-double-neg97.4%
distribute-frac-neg97.4%
sub-neg97.4%
distribute-frac-neg97.4%
neg-mul-197.4%
*-commutative97.4%
associate-/l*97.3%
*-commutative97.3%
neg-mul-197.3%
times-frac97.2%
distribute-lft-out--99.6%
*-commutative99.6%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 83.6%
*-commutative83.6%
metadata-eval83.6%
times-frac83.6%
*-rgt-identity83.6%
Simplified83.6%
*-un-lft-identity83.6%
times-frac83.5%
Applied egg-rr83.5%
associate-*r/83.6%
associate-*l/83.7%
*-un-lft-identity83.7%
Applied egg-rr83.7%
if -3.4999999999999999e-71 < y < 5.40000000000000024e-156Initial program 87.6%
sub-neg87.6%
associate-+l+87.6%
remove-double-neg87.6%
distribute-frac-neg87.6%
sub-neg87.6%
distribute-frac-neg87.6%
neg-mul-187.6%
*-commutative87.6%
associate-/l*87.6%
*-commutative87.6%
neg-mul-187.6%
times-frac88.8%
distribute-lft-out--88.8%
*-commutative88.8%
associate-/r*88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in y around 0 86.2%
Taylor expanded in x around 0 68.6%
associate-*r/68.6%
*-commutative68.6%
associate-/r*74.0%
associate-*r/74.1%
Simplified74.1%
if 5.40000000000000024e-156 < y Initial program 97.7%
sub-neg97.7%
associate-+l+97.7%
remove-double-neg97.7%
distribute-frac-neg97.7%
sub-neg97.7%
distribute-frac-neg97.7%
neg-mul-197.7%
*-commutative97.7%
associate-/l*97.7%
*-commutative97.7%
neg-mul-197.7%
times-frac97.8%
distribute-lft-out--98.8%
*-commutative98.8%
associate-/r*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in y around inf 80.3%
*-commutative80.3%
metadata-eval80.3%
times-frac80.3%
*-rgt-identity80.3%
Simplified80.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.4e-70)
(+ x (/ (/ y z) -3.0))
(if (<= y 5.4e-156)
(/ 0.3333333333333333 (* y (/ z t)))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e-70) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 5.4e-156) {
tmp = 0.3333333333333333 / (y * (z / t));
} 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 <= (-2.4d-70)) then
tmp = x + ((y / z) / (-3.0d0))
else if (y <= 5.4d-156) then
tmp = 0.3333333333333333d0 / (y * (z / t))
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 <= -2.4e-70) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 5.4e-156) {
tmp = 0.3333333333333333 / (y * (z / t));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.4e-70: tmp = x + ((y / z) / -3.0) elif y <= 5.4e-156: tmp = 0.3333333333333333 / (y * (z / t)) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.4e-70) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); elseif (y <= 5.4e-156) tmp = Float64(0.3333333333333333 / Float64(y * Float64(z / t))); 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 <= -2.4e-70) tmp = x + ((y / z) / -3.0); elseif (y <= 5.4e-156) tmp = 0.3333333333333333 / (y * (z / t)); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.4e-70], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e-156], N[(0.3333333333333333 / N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-70}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-156}:\\
\;\;\;\;\frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -2.4000000000000001e-70Initial program 97.4%
sub-neg97.4%
associate-+l+97.4%
remove-double-neg97.4%
distribute-frac-neg97.4%
sub-neg97.4%
distribute-frac-neg97.4%
neg-mul-197.4%
*-commutative97.4%
associate-/l*97.3%
*-commutative97.3%
neg-mul-197.3%
times-frac97.2%
distribute-lft-out--99.6%
*-commutative99.6%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 83.6%
*-commutative83.6%
metadata-eval83.6%
times-frac83.6%
*-rgt-identity83.6%
Simplified83.6%
*-un-lft-identity83.6%
times-frac83.5%
Applied egg-rr83.5%
associate-*r/83.6%
associate-*l/83.7%
*-un-lft-identity83.7%
Applied egg-rr83.7%
if -2.4000000000000001e-70 < y < 5.40000000000000024e-156Initial program 87.6%
sub-neg87.6%
associate-+l+87.6%
remove-double-neg87.6%
distribute-frac-neg87.6%
sub-neg87.6%
distribute-frac-neg87.6%
neg-mul-187.6%
*-commutative87.6%
associate-/l*87.6%
*-commutative87.6%
neg-mul-187.6%
times-frac88.8%
distribute-lft-out--88.8%
*-commutative88.8%
associate-/r*88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in y around 0 86.2%
Taylor expanded in x around 0 68.6%
clear-num86.2%
un-div-inv86.2%
*-commutative86.2%
Applied egg-rr68.6%
clear-num68.6%
associate-/r*74.0%
associate-/r/74.0%
clear-num74.0%
Applied egg-rr74.0%
if 5.40000000000000024e-156 < y Initial program 97.7%
sub-neg97.7%
associate-+l+97.7%
remove-double-neg97.7%
distribute-frac-neg97.7%
sub-neg97.7%
distribute-frac-neg97.7%
neg-mul-197.7%
*-commutative97.7%
associate-/l*97.7%
*-commutative97.7%
neg-mul-197.7%
times-frac97.8%
distribute-lft-out--98.8%
*-commutative98.8%
associate-/r*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in y around inf 80.3%
*-commutative80.3%
metadata-eval80.3%
times-frac80.3%
*-rgt-identity80.3%
Simplified80.3%
Final simplification79.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.6e-71)
(+ x (/ (/ y z) -3.0))
(if (<= y 5.4e-156)
(* 0.3333333333333333 (/ (/ t z) y))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.6e-71) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 5.4e-156) {
tmp = 0.3333333333333333 * ((t / z) / y);
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.6d-71)) then
tmp = x + ((y / z) / (-3.0d0))
else if (y <= 5.4d-156) then
tmp = 0.3333333333333333d0 * ((t / z) / y)
else
tmp = x + (y / (z * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.6e-71) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 5.4e-156) {
tmp = 0.3333333333333333 * ((t / z) / y);
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.6e-71: tmp = x + ((y / z) / -3.0) elif y <= 5.4e-156: tmp = 0.3333333333333333 * ((t / z) / y) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.6e-71) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); elseif (y <= 5.4e-156) tmp = Float64(0.3333333333333333 * Float64(Float64(t / z) / y)); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.6e-71) tmp = x + ((y / z) / -3.0); elseif (y <= 5.4e-156) tmp = 0.3333333333333333 * ((t / z) / y); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.6e-71], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e-156], N[(0.3333333333333333 * N[(N[(t / z), $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 -6.6 \cdot 10^{-71}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-156}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -6.6000000000000003e-71Initial program 97.4%
sub-neg97.4%
associate-+l+97.4%
remove-double-neg97.4%
distribute-frac-neg97.4%
sub-neg97.4%
distribute-frac-neg97.4%
neg-mul-197.4%
*-commutative97.4%
associate-/l*97.3%
*-commutative97.3%
neg-mul-197.3%
times-frac97.2%
distribute-lft-out--99.6%
*-commutative99.6%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 83.6%
*-commutative83.6%
metadata-eval83.6%
times-frac83.6%
*-rgt-identity83.6%
Simplified83.6%
*-un-lft-identity83.6%
times-frac83.5%
Applied egg-rr83.5%
associate-*r/83.6%
associate-*l/83.7%
*-un-lft-identity83.7%
Applied egg-rr83.7%
if -6.6000000000000003e-71 < y < 5.40000000000000024e-156Initial program 87.6%
sub-neg87.6%
associate-+l+87.6%
remove-double-neg87.6%
distribute-frac-neg87.6%
sub-neg87.6%
distribute-frac-neg87.6%
neg-mul-187.6%
*-commutative87.6%
associate-/l*87.6%
*-commutative87.6%
neg-mul-187.6%
times-frac88.8%
distribute-lft-out--88.8%
*-commutative88.8%
associate-/r*88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in y around 0 86.2%
Taylor expanded in x around 0 68.6%
associate-*r/68.6%
*-commutative68.6%
associate-/r*74.0%
associate-*r/74.1%
Simplified74.1%
associate-/l*74.0%
Applied egg-rr74.0%
if 5.40000000000000024e-156 < y Initial program 97.7%
sub-neg97.7%
associate-+l+97.7%
remove-double-neg97.7%
distribute-frac-neg97.7%
sub-neg97.7%
distribute-frac-neg97.7%
neg-mul-197.7%
*-commutative97.7%
associate-/l*97.7%
*-commutative97.7%
neg-mul-197.7%
times-frac97.8%
distribute-lft-out--98.8%
*-commutative98.8%
associate-/r*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in y around inf 80.3%
*-commutative80.3%
metadata-eval80.3%
times-frac80.3%
*-rgt-identity80.3%
Simplified80.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.6e+114) (not (<= y 2.2e+36))) (* -0.3333333333333333 (/ y z)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.6e+114) || !(y <= 2.2e+36)) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-7.6d+114)) .or. (.not. (y <= 2.2d+36))) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.6e+114) || !(y <= 2.2e+36)) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.6e+114) or not (y <= 2.2e+36): tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.6e+114) || !(y <= 2.2e+36)) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.6e+114) || ~((y <= 2.2e+36))) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.6e+114], N[Not[LessEqual[y, 2.2e+36]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+114} \lor \neg \left(y \leq 2.2 \cdot 10^{+36}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -7.6000000000000001e114 or 2.2e36 < y Initial program 97.7%
Taylor expanded in z around 0 80.2%
Taylor expanded in t around 0 76.9%
if -7.6000000000000001e114 < y < 2.2e36Initial program 93.2%
sub-neg93.2%
associate-+l+93.2%
distribute-frac-neg93.2%
neg-mul-193.2%
*-commutative93.2%
times-frac93.2%
fma-define93.2%
metadata-eval93.2%
associate-*l*93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in x around inf 38.9%
Final simplification53.5%
(FPCore (x y z t) :precision binary64 (if (<= y -1.95e+114) (* -0.3333333333333333 (/ y z)) (if (<= y 9e+35) x (/ (* y -0.3333333333333333) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.95e+114) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 9e+35) {
tmp = x;
} else {
tmp = (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 <= (-1.95d+114)) then
tmp = (-0.3333333333333333d0) * (y / z)
else if (y <= 9d+35) then
tmp = x
else
tmp = (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 <= -1.95e+114) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 9e+35) {
tmp = x;
} else {
tmp = (y * -0.3333333333333333) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.95e+114: tmp = -0.3333333333333333 * (y / z) elif y <= 9e+35: tmp = x else: tmp = (y * -0.3333333333333333) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.95e+114) tmp = Float64(-0.3333333333333333 * Float64(y / z)); elseif (y <= 9e+35) tmp = x; else tmp = Float64(Float64(y * -0.3333333333333333) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.95e+114) tmp = -0.3333333333333333 * (y / z); elseif (y <= 9e+35) tmp = x; else tmp = (y * -0.3333333333333333) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.95e+114], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+35], x, N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{+114}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+35}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.95e114Initial program 97.3%
Taylor expanded in z around 0 80.9%
Taylor expanded in t around 0 78.8%
if -1.95e114 < y < 8.9999999999999993e35Initial program 93.2%
sub-neg93.2%
associate-+l+93.2%
distribute-frac-neg93.2%
neg-mul-193.2%
*-commutative93.2%
times-frac93.2%
fma-define93.2%
metadata-eval93.2%
associate-*l*93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in x around inf 38.9%
if 8.9999999999999993e35 < y Initial program 97.9%
Taylor expanded in z around 0 79.7%
Taylor expanded in t around 0 75.5%
associate-*r/75.5%
Simplified75.5%
Final simplification53.5%
(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 94.9%
sub-neg94.9%
associate-+l+94.9%
remove-double-neg94.9%
distribute-frac-neg94.9%
sub-neg94.9%
distribute-frac-neg94.9%
neg-mul-194.9%
*-commutative94.9%
associate-/l*94.9%
*-commutative94.9%
neg-mul-194.9%
times-frac95.2%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
(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 94.9%
sub-neg94.9%
associate-+l+94.9%
distribute-frac-neg94.9%
neg-mul-194.9%
*-commutative94.9%
times-frac94.9%
fma-define94.9%
metadata-eval94.9%
associate-*l*94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in x around inf 32.3%
(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 2024160
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))