
(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 (+ (+ (/ t (* z (* y 3.0))) x) (* (/ 1.0 z) (/ y -3.0))))
double code(double x, double y, double z, double t) {
return ((t / (z * (y * 3.0))) + x) + ((1.0 / z) * (y / -3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((t / (z * (y * 3.0d0))) + x) + ((1.0d0 / z) * (y / (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return ((t / (z * (y * 3.0))) + x) + ((1.0 / z) * (y / -3.0));
}
def code(x, y, z, t): return ((t / (z * (y * 3.0))) + x) + ((1.0 / z) * (y / -3.0))
function code(x, y, z, t) return Float64(Float64(Float64(t / Float64(z * Float64(y * 3.0))) + x) + Float64(Float64(1.0 / z) * Float64(y / -3.0))) end
function tmp = code(x, y, z, t) tmp = ((t / (z * (y * 3.0))) + x) + ((1.0 / z) * (y / -3.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(N[(1.0 / z), $MachinePrecision] * N[(y / -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{1}{z} \cdot \frac{y}{-3}
\end{array}
Initial program 98.6%
+-commutative98.6%
associate-+r-98.6%
sub-neg98.6%
associate-*l*98.6%
*-commutative98.6%
distribute-frac-neg298.6%
distribute-rgt-neg-in98.6%
metadata-eval98.6%
Simplified98.6%
*-un-lft-identity98.6%
times-frac98.6%
Applied egg-rr98.6%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.3333333333333333 (/ t (* z y)))))
(if (<= y -1.2e-14)
(* y (/ -0.3333333333333333 z))
(if (<= y 1.05e-90)
t_1
(if (<= y 28000000.0)
x
(if (<= y 3.65e+59) t_1 (* 0.3333333333333333 (/ (- y) z))))))))
double code(double x, double y, double z, double t) {
double t_1 = 0.3333333333333333 * (t / (z * y));
double tmp;
if (y <= -1.2e-14) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= 1.05e-90) {
tmp = t_1;
} else if (y <= 28000000.0) {
tmp = x;
} else if (y <= 3.65e+59) {
tmp = t_1;
} else {
tmp = 0.3333333333333333 * (-y / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.3333333333333333d0 * (t / (z * y))
if (y <= (-1.2d-14)) then
tmp = y * ((-0.3333333333333333d0) / z)
else if (y <= 1.05d-90) then
tmp = t_1
else if (y <= 28000000.0d0) then
tmp = x
else if (y <= 3.65d+59) then
tmp = t_1
else
tmp = 0.3333333333333333d0 * (-y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 0.3333333333333333 * (t / (z * y));
double tmp;
if (y <= -1.2e-14) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= 1.05e-90) {
tmp = t_1;
} else if (y <= 28000000.0) {
tmp = x;
} else if (y <= 3.65e+59) {
tmp = t_1;
} else {
tmp = 0.3333333333333333 * (-y / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = 0.3333333333333333 * (t / (z * y)) tmp = 0 if y <= -1.2e-14: tmp = y * (-0.3333333333333333 / z) elif y <= 1.05e-90: tmp = t_1 elif y <= 28000000.0: tmp = x elif y <= 3.65e+59: tmp = t_1 else: tmp = 0.3333333333333333 * (-y / z) return tmp
function code(x, y, z, t) t_1 = Float64(0.3333333333333333 * Float64(t / Float64(z * y))) tmp = 0.0 if (y <= -1.2e-14) tmp = Float64(y * Float64(-0.3333333333333333 / z)); elseif (y <= 1.05e-90) tmp = t_1; elseif (y <= 28000000.0) tmp = x; elseif (y <= 3.65e+59) tmp = t_1; else tmp = Float64(0.3333333333333333 * Float64(Float64(-y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 0.3333333333333333 * (t / (z * y)); tmp = 0.0; if (y <= -1.2e-14) tmp = y * (-0.3333333333333333 / z); elseif (y <= 1.05e-90) tmp = t_1; elseif (y <= 28000000.0) tmp = x; elseif (y <= 3.65e+59) tmp = t_1; else tmp = 0.3333333333333333 * (-y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2e-14], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-90], t$95$1, If[LessEqual[y, 28000000.0], x, If[LessEqual[y, 3.65e+59], t$95$1, N[(0.3333333333333333 * N[((-y) / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{-14}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 28000000:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.65 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{-y}{z}\\
\end{array}
\end{array}
if y < -1.2e-14Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.8%
*-commutative99.8%
Simplified99.7%
Taylor expanded in y around inf 96.6%
sub-neg96.6%
associate-*r/96.6%
metadata-eval96.6%
distribute-neg-frac96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in x around 0 71.9%
if -1.2e-14 < y < 1.05e-90 or 2.8e7 < y < 3.6500000000000001e59Initial program 97.2%
+-commutative97.2%
associate-+r-97.2%
sub-neg97.2%
associate-*l*97.3%
*-commutative97.3%
distribute-frac-neg297.3%
distribute-rgt-neg-in97.3%
metadata-eval97.3%
Simplified97.3%
*-un-lft-identity97.3%
times-frac97.3%
Applied egg-rr97.3%
Taylor expanded in t around inf 65.5%
if 1.05e-90 < y < 2.8e7Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac95.9%
distribute-frac-neg95.9%
neg-mul-195.9%
*-commutative95.9%
associate-/l*95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in x around inf 50.2%
if 3.6500000000000001e59 < y Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
sub-neg99.8%
associate-*l*99.7%
*-commutative99.7%
distribute-frac-neg299.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
*-un-lft-identity99.7%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 72.9%
+-commutative72.9%
metadata-eval72.9%
associate-*r*72.9%
neg-mul-172.9%
distribute-lft-in72.9%
sub-neg72.9%
associate-*r/73.1%
Simplified73.1%
Taylor expanded in t around 0 69.6%
neg-mul-169.6%
distribute-neg-frac269.6%
Simplified69.6%
Final simplification66.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -0.00017)
(* y (/ -0.3333333333333333 z))
(if (<= y -1.55e-116)
x
(if (<= y -1.25e-217)
(* 0.3333333333333333 (/ (/ t y) z))
(if (<= y 2.2e+51)
(* 0.3333333333333333 (/ t (* z y)))
(* 0.3333333333333333 (/ (- y) z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.00017) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= -1.55e-116) {
tmp = x;
} else if (y <= -1.25e-217) {
tmp = 0.3333333333333333 * ((t / y) / z);
} else if (y <= 2.2e+51) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = 0.3333333333333333 * (-y / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-0.00017d0)) then
tmp = y * ((-0.3333333333333333d0) / z)
else if (y <= (-1.55d-116)) then
tmp = x
else if (y <= (-1.25d-217)) then
tmp = 0.3333333333333333d0 * ((t / y) / z)
else if (y <= 2.2d+51) then
tmp = 0.3333333333333333d0 * (t / (z * y))
else
tmp = 0.3333333333333333d0 * (-y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.00017) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= -1.55e-116) {
tmp = x;
} else if (y <= -1.25e-217) {
tmp = 0.3333333333333333 * ((t / y) / z);
} else if (y <= 2.2e+51) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = 0.3333333333333333 * (-y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -0.00017: tmp = y * (-0.3333333333333333 / z) elif y <= -1.55e-116: tmp = x elif y <= -1.25e-217: tmp = 0.3333333333333333 * ((t / y) / z) elif y <= 2.2e+51: tmp = 0.3333333333333333 * (t / (z * y)) else: tmp = 0.3333333333333333 * (-y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -0.00017) tmp = Float64(y * Float64(-0.3333333333333333 / z)); elseif (y <= -1.55e-116) tmp = x; elseif (y <= -1.25e-217) tmp = Float64(0.3333333333333333 * Float64(Float64(t / y) / z)); elseif (y <= 2.2e+51) tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); else tmp = Float64(0.3333333333333333 * Float64(Float64(-y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -0.00017) tmp = y * (-0.3333333333333333 / z); elseif (y <= -1.55e-116) tmp = x; elseif (y <= -1.25e-217) tmp = 0.3333333333333333 * ((t / y) / z); elseif (y <= 2.2e+51) tmp = 0.3333333333333333 * (t / (z * y)); else tmp = 0.3333333333333333 * (-y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.00017], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.55e-116], x, If[LessEqual[y, -1.25e-217], N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+51], N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[((-y) / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00017:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-116}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{-217}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+51}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{-y}{z}\\
\end{array}
\end{array}
if y < -1.7e-4Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.8%
*-commutative99.8%
Simplified99.7%
Taylor expanded in y around inf 96.6%
sub-neg96.6%
associate-*r/96.6%
metadata-eval96.6%
distribute-neg-frac96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in x around 0 73.0%
if -1.7e-4 < y < -1.55000000000000009e-116Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac90.3%
distribute-frac-neg90.3%
neg-mul-190.3%
*-commutative90.3%
associate-/l*90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in x around inf 55.8%
if -1.55000000000000009e-116 < y < -1.2500000000000001e-217Initial program 90.3%
+-commutative90.3%
associate-+r-90.3%
sub-neg90.3%
associate-*l*90.4%
*-commutative90.4%
distribute-frac-neg290.4%
distribute-rgt-neg-in90.4%
metadata-eval90.4%
Simplified90.4%
*-un-lft-identity90.4%
times-frac90.4%
Applied egg-rr90.4%
Taylor expanded in t around inf 56.6%
associate-/r*65.7%
Simplified65.7%
if -1.2500000000000001e-217 < y < 2.19999999999999992e51Initial program 98.7%
+-commutative98.7%
associate-+r-98.7%
sub-neg98.7%
associate-*l*98.7%
*-commutative98.7%
distribute-frac-neg298.7%
distribute-rgt-neg-in98.7%
metadata-eval98.7%
Simplified98.7%
*-un-lft-identity98.7%
times-frac98.7%
Applied egg-rr98.7%
Taylor expanded in t around inf 63.6%
if 2.19999999999999992e51 < y Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
sub-neg99.8%
associate-*l*99.7%
*-commutative99.7%
distribute-frac-neg299.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
*-un-lft-identity99.7%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 72.9%
+-commutative72.9%
metadata-eval72.9%
associate-*r*72.9%
neg-mul-172.9%
distribute-lft-in72.9%
sub-neg72.9%
associate-*r/73.1%
Simplified73.1%
Taylor expanded in t around 0 69.6%
neg-mul-169.6%
distribute-neg-frac269.6%
Simplified69.6%
Final simplification66.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (* z 3.0) -2e+72) (not (<= (* z 3.0) 2000000000.0))) (+ x (* -0.3333333333333333 (/ y z))) (* 0.3333333333333333 (/ (- (/ t y) y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -2e+72) || !((z * 3.0) <= 2000000000.0)) {
tmp = x + (-0.3333333333333333 * (y / 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 (((z * 3.0d0) <= (-2d+72)) .or. (.not. ((z * 3.0d0) <= 2000000000.0d0))) then
tmp = x + ((-0.3333333333333333d0) * (y / 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 (((z * 3.0) <= -2e+72) || !((z * 3.0) <= 2000000000.0)) {
tmp = x + (-0.3333333333333333 * (y / z));
} else {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * 3.0) <= -2e+72) or not ((z * 3.0) <= 2000000000.0): tmp = x + (-0.3333333333333333 * (y / z)) else: tmp = 0.3333333333333333 * (((t / y) - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * 3.0) <= -2e+72) || !(Float64(z * 3.0) <= 2000000000.0)) tmp = Float64(x + Float64(-0.3333333333333333 * Float64(y / 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 (((z * 3.0) <= -2e+72) || ~(((z * 3.0) <= 2000000000.0))) tmp = x + (-0.3333333333333333 * (y / z)); else tmp = 0.3333333333333333 * (((t / y) - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -2e+72], N[Not[LessEqual[N[(z * 3.0), $MachinePrecision], 2000000000.0]], $MachinePrecision]], N[(x + N[(-0.3333333333333333 * N[(y / 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}\;z \cdot 3 \leq -2 \cdot 10^{+72} \lor \neg \left(z \cdot 3 \leq 2000000000\right):\\
\;\;\;\;x + -0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -1.99999999999999989e72 or 2e9 < (*.f64 z #s(literal 3 binary64)) Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
+-commutative99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
sub-neg99.7%
neg-mul-199.7%
times-frac90.5%
distribute-frac-neg90.5%
neg-mul-190.5%
*-commutative90.5%
associate-/l*90.5%
*-commutative90.5%
Simplified90.4%
Taylor expanded in t around 0 80.9%
+-commutative80.9%
Simplified80.9%
if -1.99999999999999989e72 < (*.f64 z #s(literal 3 binary64)) < 2e9Initial program 97.8%
+-commutative97.8%
associate-+r-97.8%
sub-neg97.8%
associate-*l*97.8%
*-commutative97.8%
distribute-frac-neg297.8%
distribute-rgt-neg-in97.8%
metadata-eval97.8%
Simplified97.8%
*-un-lft-identity97.8%
times-frac97.8%
Applied egg-rr97.8%
Taylor expanded in z around 0 91.5%
+-commutative91.5%
metadata-eval91.5%
associate-*r*91.5%
neg-mul-191.5%
distribute-lft-in91.5%
sub-neg91.5%
associate-*r/91.0%
Simplified91.0%
Final simplification87.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -0.00016)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 1e+38)
(+ x (* 0.3333333333333333 (/ t (* z y))))
(+ x (* -0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.00016) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 1e+38) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x + (-0.3333333333333333 * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-0.00016d0)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 1d+38) then
tmp = x + (0.3333333333333333d0 * (t / (z * y)))
else
tmp = x + ((-0.3333333333333333d0) * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.00016) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 1e+38) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x + (-0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -0.00016: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 1e+38: tmp = x + (0.3333333333333333 * (t / (z * y))) else: tmp = x + (-0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -0.00016) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 1e+38) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(z * y)))); else tmp = Float64(x + Float64(-0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -0.00016) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 1e+38) tmp = x + (0.3333333333333333 * (t / (z * y))); else tmp = x + (-0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.00016], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+38], N[(x + N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00016:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 10^{+38}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + -0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -1.60000000000000013e-4Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.8%
*-commutative99.8%
Simplified99.7%
Taylor expanded in x around 0 98.3%
+-commutative98.3%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 96.6%
if -1.60000000000000013e-4 < y < 9.99999999999999977e37Initial program 97.7%
sub-neg97.7%
associate-+l+97.7%
+-commutative97.7%
remove-double-neg97.7%
distribute-frac-neg97.7%
distribute-neg-in97.7%
remove-double-neg97.7%
sub-neg97.7%
neg-mul-197.7%
times-frac93.1%
distribute-frac-neg93.1%
neg-mul-193.1%
*-commutative93.1%
associate-/l*93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in t around inf 91.0%
if 9.99999999999999977e37 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
*-commutative99.8%
Simplified99.7%
Taylor expanded in t around 0 96.5%
+-commutative96.5%
Simplified96.5%
Final simplification93.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4e-116) (not (<= y 1e-90))) (+ x (* -0.3333333333333333 (/ y z))) (* 0.3333333333333333 (/ t (* z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4e-116) || !(y <= 1e-90)) {
tmp = x + (-0.3333333333333333 * (y / z));
} 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 <= (-4d-116)) .or. (.not. (y <= 1d-90))) then
tmp = x + ((-0.3333333333333333d0) * (y / z))
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 <= -4e-116) || !(y <= 1e-90)) {
tmp = x + (-0.3333333333333333 * (y / z));
} else {
tmp = 0.3333333333333333 * (t / (z * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4e-116) or not (y <= 1e-90): tmp = x + (-0.3333333333333333 * (y / z)) else: tmp = 0.3333333333333333 * (t / (z * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4e-116) || !(y <= 1e-90)) tmp = Float64(x + Float64(-0.3333333333333333 * Float64(y / z))); else tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4e-116) || ~((y <= 1e-90))) tmp = x + (-0.3333333333333333 * (y / z)); else tmp = 0.3333333333333333 * (t / (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4e-116], N[Not[LessEqual[y, 1e-90]], $MachinePrecision]], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-116} \lor \neg \left(y \leq 10^{-90}\right):\\
\;\;\;\;x + -0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\end{array}
\end{array}
if y < -4e-116 or 9.99999999999999995e-91 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac98.1%
distribute-frac-neg98.1%
neg-mul-198.1%
*-commutative98.1%
associate-/l*98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in t around 0 84.6%
+-commutative84.6%
Simplified84.6%
if -4e-116 < y < 9.99999999999999995e-91Initial program 96.3%
+-commutative96.3%
associate-+r-96.3%
sub-neg96.3%
associate-*l*96.3%
*-commutative96.3%
distribute-frac-neg296.3%
distribute-rgt-neg-in96.3%
metadata-eval96.3%
Simplified96.3%
*-un-lft-identity96.3%
times-frac96.3%
Applied egg-rr96.3%
Taylor expanded in t around inf 71.6%
Final simplification80.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.2e-116)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 1.4e-90)
(* 0.3333333333333333 (/ t (* z y)))
(+ x (* -0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e-116) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 1.4e-90) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = x + (-0.3333333333333333 * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.2d-116)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 1.4d-90) then
tmp = 0.3333333333333333d0 * (t / (z * y))
else
tmp = x + ((-0.3333333333333333d0) * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e-116) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 1.4e-90) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = x + (-0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.2e-116: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 1.4e-90: tmp = 0.3333333333333333 * (t / (z * y)) else: tmp = x + (-0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.2e-116) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 1.4e-90) tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); else tmp = Float64(x + Float64(-0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.2e-116) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 1.4e-90) tmp = 0.3333333333333333 * (t / (z * y)); else tmp = x + (-0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.2e-116], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e-90], N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-116}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-90}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + -0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -6.20000000000000036e-116Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac97.3%
distribute-frac-neg97.3%
neg-mul-197.3%
*-commutative97.3%
associate-/l*97.3%
*-commutative97.3%
Simplified97.3%
Taylor expanded in x around 0 96.3%
+-commutative96.3%
associate-*r/97.3%
Simplified97.3%
Taylor expanded in t around 0 88.7%
if -6.20000000000000036e-116 < y < 1.3999999999999999e-90Initial program 96.3%
+-commutative96.3%
associate-+r-96.3%
sub-neg96.3%
associate-*l*96.3%
*-commutative96.3%
distribute-frac-neg296.3%
distribute-rgt-neg-in96.3%
metadata-eval96.3%
Simplified96.3%
*-un-lft-identity96.3%
times-frac96.3%
Applied egg-rr96.3%
Taylor expanded in t around inf 71.6%
if 1.3999999999999999e-90 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in t around 0 82.0%
+-commutative82.0%
Simplified82.0%
Final simplification80.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.6e-118)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 9.2e-91)
(/ (* t (/ 0.3333333333333333 z)) y)
(+ x (* -0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e-118) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 9.2e-91) {
tmp = (t * (0.3333333333333333 / z)) / y;
} else {
tmp = x + (-0.3333333333333333 * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.6d-118)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 9.2d-91) then
tmp = (t * (0.3333333333333333d0 / z)) / y
else
tmp = x + ((-0.3333333333333333d0) * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e-118) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 9.2e-91) {
tmp = (t * (0.3333333333333333 / z)) / y;
} else {
tmp = x + (-0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.6e-118: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 9.2e-91: tmp = (t * (0.3333333333333333 / z)) / y else: tmp = x + (-0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.6e-118) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 9.2e-91) tmp = Float64(Float64(t * Float64(0.3333333333333333 / z)) / y); else tmp = Float64(x + Float64(-0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.6e-118) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 9.2e-91) tmp = (t * (0.3333333333333333 / z)) / y; else tmp = x + (-0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.6e-118], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-91], N[(N[(t * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-118}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-91}:\\
\;\;\;\;\frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + -0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -2.6e-118Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac97.3%
distribute-frac-neg97.3%
neg-mul-197.3%
*-commutative97.3%
associate-/l*97.3%
*-commutative97.3%
Simplified97.3%
Taylor expanded in x around 0 96.3%
+-commutative96.3%
associate-*r/97.3%
Simplified97.3%
Taylor expanded in t around 0 88.7%
if -2.6e-118 < y < 9.19999999999999982e-91Initial program 96.3%
sub-neg96.3%
associate-+l+96.3%
+-commutative96.3%
remove-double-neg96.3%
distribute-frac-neg96.3%
distribute-neg-in96.3%
remove-double-neg96.3%
sub-neg96.3%
neg-mul-196.3%
times-frac92.1%
distribute-frac-neg92.1%
neg-mul-192.1%
*-commutative92.1%
associate-/l*92.1%
*-commutative92.1%
Simplified92.1%
Taylor expanded in y around 0 95.3%
Taylor expanded in t around inf 74.0%
associate-*r/74.0%
*-commutative74.0%
associate-*r/74.0%
Simplified74.0%
if 9.19999999999999982e-91 < y Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in t around 0 82.0%
+-commutative82.0%
Simplified82.0%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (<= x -3.1e+147) x (if (<= x 1.9e-12) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.1e+147) {
tmp = x;
} else if (x <= 1.9e-12) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-3.1d+147)) then
tmp = x
else if (x <= 1.9d-12) then
tmp = y * ((-0.3333333333333333d0) / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.1e+147) {
tmp = x;
} else if (x <= 1.9e-12) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.1e+147: tmp = x elif x <= 1.9e-12: tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.1e+147) tmp = x; elseif (x <= 1.9e-12) tmp = Float64(y * Float64(-0.3333333333333333 / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.1e+147) tmp = x; elseif (x <= 1.9e-12) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.1e+147], x, If[LessEqual[x, 1.9e-12], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+147}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-12}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.1e147 or 1.89999999999999998e-12 < x Initial program 98.9%
sub-neg98.9%
associate-+l+98.9%
+-commutative98.9%
remove-double-neg98.9%
distribute-frac-neg98.9%
distribute-neg-in98.9%
remove-double-neg98.9%
sub-neg98.9%
neg-mul-198.9%
times-frac95.9%
distribute-frac-neg95.9%
neg-mul-195.9%
*-commutative95.9%
associate-/l*95.9%
*-commutative95.9%
Simplified96.0%
Taylor expanded in x around inf 61.9%
if -3.1e147 < x < 1.89999999999999998e-12Initial program 98.4%
sub-neg98.4%
associate-+l+98.4%
+-commutative98.4%
remove-double-neg98.4%
distribute-frac-neg98.4%
distribute-neg-in98.4%
remove-double-neg98.4%
sub-neg98.4%
neg-mul-198.4%
times-frac96.1%
distribute-frac-neg96.1%
neg-mul-196.1%
*-commutative96.1%
associate-/l*96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in y around inf 59.5%
sub-neg59.5%
associate-*r/59.5%
metadata-eval59.5%
distribute-neg-frac59.5%
metadata-eval59.5%
Simplified59.5%
Taylor expanded in x around 0 49.4%
Final simplification54.2%
(FPCore (x y z t) :precision binary64 (if (<= x -2.3e+146) x (if (<= x 2.2e-12) (/ y (* z -3.0)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.3e+146) {
tmp = x;
} else if (x <= 2.2e-12) {
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 <= (-2.3d+146)) then
tmp = x
else if (x <= 2.2d-12) 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 <= -2.3e+146) {
tmp = x;
} else if (x <= 2.2e-12) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.3e+146: tmp = x elif x <= 2.2e-12: tmp = y / (z * -3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.3e+146) tmp = x; elseif (x <= 2.2e-12) 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 <= -2.3e+146) tmp = x; elseif (x <= 2.2e-12) tmp = y / (z * -3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.3e+146], x, If[LessEqual[x, 2.2e-12], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+146}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-12}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.3e146 or 2.19999999999999992e-12 < x Initial program 98.9%
sub-neg98.9%
associate-+l+98.9%
+-commutative98.9%
remove-double-neg98.9%
distribute-frac-neg98.9%
distribute-neg-in98.9%
remove-double-neg98.9%
sub-neg98.9%
neg-mul-198.9%
times-frac95.9%
distribute-frac-neg95.9%
neg-mul-195.9%
*-commutative95.9%
associate-/l*95.9%
*-commutative95.9%
Simplified96.0%
Taylor expanded in x around inf 61.9%
if -2.3e146 < x < 2.19999999999999992e-12Initial program 98.4%
sub-neg98.4%
associate-+l+98.4%
+-commutative98.4%
remove-double-neg98.4%
distribute-frac-neg98.4%
distribute-neg-in98.4%
remove-double-neg98.4%
sub-neg98.4%
neg-mul-198.4%
times-frac96.1%
distribute-frac-neg96.1%
neg-mul-196.1%
*-commutative96.1%
associate-/l*96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in y around inf 59.5%
sub-neg59.5%
associate-*r/59.5%
metadata-eval59.5%
distribute-neg-frac59.5%
metadata-eval59.5%
Simplified59.5%
Taylor expanded in x around 0 49.4%
clear-num49.4%
un-div-inv49.5%
div-inv49.5%
metadata-eval49.5%
Applied egg-rr49.5%
Final simplification54.2%
(FPCore (x y z t) :precision binary64 (+ (+ (/ t (* z (* y 3.0))) x) (/ y (* z -3.0))))
double code(double x, double y, double z, double t) {
return ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((t / (z * (y * 3.0d0))) + x) + (y / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0));
}
def code(x, y, z, t): return ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0))
function code(x, y, z, t) return Float64(Float64(Float64(t / Float64(z * Float64(y * 3.0))) + x) + Float64(y / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot -3}
\end{array}
Initial program 98.6%
+-commutative98.6%
associate-+r-98.6%
sub-neg98.6%
associate-*l*98.6%
*-commutative98.6%
distribute-frac-neg298.6%
distribute-rgt-neg-in98.6%
metadata-eval98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (x y z t) :precision binary64 (+ x (* (- (/ t y) y) (/ 0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - y) * (0.3333333333333333 / z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (((t / y) - y) * (0.3333333333333333d0 / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) * (0.3333333333333333 / z));
}
def code(x, y, z, t): return x + (((t / y) - y) * (0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) * Float64(0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) * (0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\frac{t}{y} - y\right) \cdot \frac{0.3333333333333333}{z}
\end{array}
Initial program 98.6%
sub-neg98.6%
associate-+l+98.6%
+-commutative98.6%
remove-double-neg98.6%
distribute-frac-neg98.6%
distribute-neg-in98.6%
remove-double-neg98.6%
sub-neg98.6%
neg-mul-198.6%
times-frac96.0%
distribute-frac-neg96.0%
neg-mul-196.0%
*-commutative96.0%
associate-/l*96.0%
*-commutative96.0%
Simplified96.0%
Final simplification96.0%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (((t / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t): return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Initial program 98.6%
sub-neg98.6%
associate-+l+98.6%
+-commutative98.6%
remove-double-neg98.6%
distribute-frac-neg98.6%
distribute-neg-in98.6%
remove-double-neg98.6%
sub-neg98.6%
neg-mul-198.6%
times-frac96.0%
distribute-frac-neg96.0%
neg-mul-196.0%
*-commutative96.0%
associate-/l*96.0%
*-commutative96.0%
Simplified96.0%
*-commutative96.0%
clear-num96.0%
div-inv96.0%
metadata-eval96.0%
un-div-inv96.1%
Applied egg-rr96.1%
Final simplification96.1%
(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 98.6%
sub-neg98.6%
associate-+l+98.6%
+-commutative98.6%
remove-double-neg98.6%
distribute-frac-neg98.6%
distribute-neg-in98.6%
remove-double-neg98.6%
sub-neg98.6%
neg-mul-198.6%
times-frac96.0%
distribute-frac-neg96.0%
neg-mul-196.0%
*-commutative96.0%
associate-/l*96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in x around inf 31.2%
Final simplification31.2%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2024078
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))