
(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 (<= (* 3.0 z) -2e+62)
(+ (/ y (* z -3.0)) (+ x (/ t (* (* y 3.0) z))))
(if (<= (* 3.0 z) 2e-111)
(+ x (* (/ 0.3333333333333333 z) (- (/ t y) y)))
(+ (- x (/ y (* 3.0 z))) (/ t (* y (* 3.0 z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((3.0 * z) <= -2e+62) {
tmp = (y / (z * -3.0)) + (x + (t / ((y * 3.0) * z)));
} else if ((3.0 * z) <= 2e-111) {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
} else {
tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * 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 ((3.0d0 * z) <= (-2d+62)) then
tmp = (y / (z * (-3.0d0))) + (x + (t / ((y * 3.0d0) * z)))
else if ((3.0d0 * z) <= 2d-111) then
tmp = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
else
tmp = (x - (y / (3.0d0 * z))) + (t / (y * (3.0d0 * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((3.0 * z) <= -2e+62) {
tmp = (y / (z * -3.0)) + (x + (t / ((y * 3.0) * z)));
} else if ((3.0 * z) <= 2e-111) {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
} else {
tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (3.0 * z) <= -2e+62: tmp = (y / (z * -3.0)) + (x + (t / ((y * 3.0) * z))) elif (3.0 * z) <= 2e-111: tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)) else: tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(3.0 * z) <= -2e+62) tmp = Float64(Float64(y / Float64(z * -3.0)) + Float64(x + Float64(t / Float64(Float64(y * 3.0) * z)))); elseif (Float64(3.0 * z) <= 2e-111) tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))); else tmp = Float64(Float64(x - Float64(y / Float64(3.0 * z))) + Float64(t / Float64(y * Float64(3.0 * z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((3.0 * z) <= -2e+62) tmp = (y / (z * -3.0)) + (x + (t / ((y * 3.0) * z))); elseif ((3.0 * z) <= 2e-111) tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); else tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(3.0 * z), $MachinePrecision], -2e+62], N[(N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t / N[(N[(y * 3.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(3.0 * z), $MachinePrecision], 2e-111], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;3 \cdot z \leq -2 \cdot 10^{+62}:\\
\;\;\;\;\frac{y}{z \cdot -3} + \left(x + \frac{t}{\left(y \cdot 3\right) \cdot z}\right)\\
\mathbf{elif}\;3 \cdot z \leq 2 \cdot 10^{-111}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{3 \cdot z}\right) + \frac{t}{y \cdot \left(3 \cdot z\right)}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -2.00000000000000007e62Initial program 99.6%
+-commutative99.6%
associate-+r-99.6%
sub-neg99.6%
associate-*l*99.7%
*-commutative99.7%
distribute-frac-neg299.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
if -2.00000000000000007e62 < (*.f64 z #s(literal 3 binary64)) < 2.00000000000000018e-111Initial program 89.1%
sub-neg89.1%
associate-+l+89.1%
+-commutative89.1%
remove-double-neg89.1%
distribute-frac-neg89.1%
distribute-neg-in89.1%
remove-double-neg89.1%
sub-neg89.1%
neg-mul-189.1%
times-frac98.9%
distribute-frac-neg98.9%
neg-mul-198.9%
*-commutative98.9%
associate-/l*98.9%
*-commutative98.9%
Simplified99.8%
if 2.00000000000000018e-111 < (*.f64 z #s(literal 3 binary64)) Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (* 3.0 z) -2e+62) (not (<= (* 3.0 z) 2e-111))) (+ (/ y (* z -3.0)) (+ x (/ t (* (* y 3.0) z)))) (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((3.0 * z) <= -2e+62) || !((3.0 * z) <= 2e-111)) {
tmp = (y / (z * -3.0)) + (x + (t / ((y * 3.0) * z)));
} else {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((3.0d0 * z) <= (-2d+62)) .or. (.not. ((3.0d0 * z) <= 2d-111))) then
tmp = (y / (z * (-3.0d0))) + (x + (t / ((y * 3.0d0) * z)))
else
tmp = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((3.0 * z) <= -2e+62) || !((3.0 * z) <= 2e-111)) {
tmp = (y / (z * -3.0)) + (x + (t / ((y * 3.0) * z)));
} else {
tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((3.0 * z) <= -2e+62) or not ((3.0 * z) <= 2e-111): tmp = (y / (z * -3.0)) + (x + (t / ((y * 3.0) * z))) else: tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(3.0 * z) <= -2e+62) || !(Float64(3.0 * z) <= 2e-111)) tmp = Float64(Float64(y / Float64(z * -3.0)) + Float64(x + Float64(t / Float64(Float64(y * 3.0) * z)))); else tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((3.0 * z) <= -2e+62) || ~(((3.0 * z) <= 2e-111))) tmp = (y / (z * -3.0)) + (x + (t / ((y * 3.0) * z))); else tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(3.0 * z), $MachinePrecision], -2e+62], N[Not[LessEqual[N[(3.0 * z), $MachinePrecision], 2e-111]], $MachinePrecision]], N[(N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t / N[(N[(y * 3.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;3 \cdot z \leq -2 \cdot 10^{+62} \lor \neg \left(3 \cdot z \leq 2 \cdot 10^{-111}\right):\\
\;\;\;\;\frac{y}{z \cdot -3} + \left(x + \frac{t}{\left(y \cdot 3\right) \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -2.00000000000000007e62 or 2.00000000000000018e-111 < (*.f64 z #s(literal 3 binary64)) Initial 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 -2.00000000000000007e62 < (*.f64 z #s(literal 3 binary64)) < 2.00000000000000018e-111Initial program 89.1%
sub-neg89.1%
associate-+l+89.1%
+-commutative89.1%
remove-double-neg89.1%
distribute-frac-neg89.1%
distribute-neg-in89.1%
remove-double-neg89.1%
sub-neg89.1%
neg-mul-189.1%
times-frac98.9%
distribute-frac-neg98.9%
neg-mul-198.9%
*-commutative98.9%
associate-/l*98.9%
*-commutative98.9%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(if (<= (* 3.0 z) -5e+108)
(- x (/ (* y 0.3333333333333333) z))
(if (<= (* 3.0 z) 5e+33)
(* 0.3333333333333333 (/ (- (/ t y) y) z))
(- x (* 0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((3.0 * z) <= -5e+108) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if ((3.0 * z) <= 5e+33) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((3.0d0 * z) <= (-5d+108)) then
tmp = x - ((y * 0.3333333333333333d0) / z)
else if ((3.0d0 * z) <= 5d+33) then
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
else
tmp = x - (0.3333333333333333d0 * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((3.0 * z) <= -5e+108) {
tmp = x - ((y * 0.3333333333333333) / z);
} else if ((3.0 * z) <= 5e+33) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (3.0 * z) <= -5e+108: tmp = x - ((y * 0.3333333333333333) / z) elif (3.0 * z) <= 5e+33: tmp = 0.3333333333333333 * (((t / y) - y) / z) else: tmp = x - (0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(3.0 * z) <= -5e+108) tmp = Float64(x - Float64(Float64(y * 0.3333333333333333) / z)); elseif (Float64(3.0 * z) <= 5e+33) tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); else tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((3.0 * z) <= -5e+108) tmp = x - ((y * 0.3333333333333333) / z); elseif ((3.0 * z) <= 5e+33) tmp = 0.3333333333333333 * (((t / y) - y) / z); else tmp = x - (0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(3.0 * z), $MachinePrecision], -5e+108], N[(x - N[(N[(y * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(3.0 * z), $MachinePrecision], 5e+33], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;3 \cdot z \leq -5 \cdot 10^{+108}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;3 \cdot z \leq 5 \cdot 10^{+33}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -4.99999999999999991e108Initial program 99.6%
sub-neg99.6%
associate-+l+99.6%
+-commutative99.6%
remove-double-neg99.6%
distribute-frac-neg99.6%
distribute-neg-in99.6%
remove-double-neg99.6%
sub-neg99.6%
neg-mul-199.6%
times-frac89.2%
distribute-frac-neg89.2%
neg-mul-189.2%
*-commutative89.2%
associate-/l*89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in t around 0 80.6%
metadata-eval80.6%
cancel-sign-sub-inv80.6%
associate-*r/80.7%
Simplified80.7%
if -4.99999999999999991e108 < (*.f64 z #s(literal 3 binary64)) < 4.99999999999999973e33Initial program 92.0%
sub-neg92.0%
associate-+l+92.0%
+-commutative92.0%
remove-double-neg92.0%
distribute-frac-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
sub-neg92.0%
neg-mul-192.0%
times-frac99.2%
distribute-frac-neg99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.1%
*-commutative99.1%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 85.7%
if 4.99999999999999973e33 < (*.f64 z #s(literal 3 binary64)) Initial program 99.7%
Taylor expanded in t around 0 73.7%
Final simplification82.2%
(FPCore (x y z t) :precision binary64 (if (<= t 3e-190) (+ (+ (* (/ 1.0 (* y 3.0)) (/ t z)) x) (/ y (* z -3.0))) (+ (- x (/ y (* 3.0 z))) (/ t (* y (* 3.0 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3e-190) {
tmp = (((1.0 / (y * 3.0)) * (t / z)) + x) + (y / (z * -3.0));
} else {
tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * 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 (t <= 3d-190) then
tmp = (((1.0d0 / (y * 3.0d0)) * (t / z)) + x) + (y / (z * (-3.0d0)))
else
tmp = (x - (y / (3.0d0 * z))) + (t / (y * (3.0d0 * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3e-190) {
tmp = (((1.0 / (y * 3.0)) * (t / z)) + x) + (y / (z * -3.0));
} else {
tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3e-190: tmp = (((1.0 / (y * 3.0)) * (t / z)) + x) + (y / (z * -3.0)) else: tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3e-190) tmp = Float64(Float64(Float64(Float64(1.0 / Float64(y * 3.0)) * Float64(t / z)) + x) + Float64(y / Float64(z * -3.0))); else tmp = Float64(Float64(x - Float64(y / Float64(3.0 * z))) + Float64(t / Float64(y * Float64(3.0 * z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3e-190) tmp = (((1.0 / (y * 3.0)) * (t / z)) + x) + (y / (z * -3.0)); else tmp = (x - (y / (3.0 * z))) + (t / (y * (3.0 * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3e-190], N[(N[(N[(N[(1.0 / N[(y * 3.0), $MachinePrecision]), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3 \cdot 10^{-190}:\\
\;\;\;\;\left(\frac{1}{y \cdot 3} \cdot \frac{t}{z} + x\right) + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{3 \cdot z}\right) + \frac{t}{y \cdot \left(3 \cdot z\right)}\\
\end{array}
\end{array}
if t < 2.9999999999999998e-190Initial program 92.1%
+-commutative92.1%
associate-+r-92.1%
sub-neg92.1%
associate-*l*92.1%
*-commutative92.1%
distribute-frac-neg292.1%
distribute-rgt-neg-in92.1%
metadata-eval92.1%
Simplified92.1%
*-un-lft-identity92.1%
*-commutative92.1%
times-frac98.5%
Applied egg-rr98.5%
if 2.9999999999999998e-190 < t Initial program 98.9%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.1e+26)
(- x (/ y (* 3.0 z)))
(if (<= y 1660000000000.0)
(+ x (/ (/ t z) (* y 3.0)))
(- x (/ 0.3333333333333333 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.1e+26) {
tmp = x - (y / (3.0 * z));
} else if (y <= 1660000000000.0) {
tmp = x + ((t / z) / (y * 3.0));
} else {
tmp = x - (0.3333333333333333 / (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 <= (-4.1d+26)) then
tmp = x - (y / (3.0d0 * z))
else if (y <= 1660000000000.0d0) then
tmp = x + ((t / z) / (y * 3.0d0))
else
tmp = x - (0.3333333333333333d0 / (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.1e+26) {
tmp = x - (y / (3.0 * z));
} else if (y <= 1660000000000.0) {
tmp = x + ((t / z) / (y * 3.0));
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.1e+26: tmp = x - (y / (3.0 * z)) elif y <= 1660000000000.0: tmp = x + ((t / z) / (y * 3.0)) else: tmp = x - (0.3333333333333333 / (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.1e+26) tmp = Float64(x - Float64(y / Float64(3.0 * z))); elseif (y <= 1660000000000.0) tmp = Float64(x + Float64(Float64(t / z) / Float64(y * 3.0))); else tmp = Float64(x - Float64(0.3333333333333333 / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.1e+26) tmp = x - (y / (3.0 * z)); elseif (y <= 1660000000000.0) tmp = x + ((t / z) / (y * 3.0)); else tmp = x - (0.3333333333333333 / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.1e+26], N[(x - N[(y / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1660000000000.0], N[(x + N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+26}:\\
\;\;\;\;x - \frac{y}{3 \cdot z}\\
\mathbf{elif}\;y \leq 1660000000000:\\
\;\;\;\;x + \frac{\frac{t}{z}}{y \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -4.09999999999999983e26Initial program 99.9%
sub-neg99.9%
associate-+l+99.9%
+-commutative99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
neg-mul-199.9%
times-frac99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.8%
*-commutative99.8%
Simplified99.7%
Taylor expanded in t around 0 94.6%
metadata-eval94.6%
cancel-sign-sub-inv94.6%
associate-*r/94.6%
Simplified94.6%
associate-*l/94.5%
Applied egg-rr94.5%
*-commutative94.5%
clear-num94.5%
un-div-inv94.6%
div-inv94.7%
metadata-eval94.7%
Applied egg-rr94.7%
if -4.09999999999999983e26 < y < 1.66e12Initial program 92.0%
sub-neg92.0%
associate-+l+92.0%
+-commutative92.0%
remove-double-neg92.0%
distribute-frac-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
sub-neg92.0%
neg-mul-192.0%
times-frac91.8%
distribute-frac-neg91.8%
neg-mul-191.8%
*-commutative91.8%
associate-/l*91.8%
*-commutative91.8%
Simplified91.9%
Taylor expanded in t around inf 87.0%
associate-*r/86.9%
Simplified86.9%
*-commutative86.9%
*-commutative86.9%
times-frac92.8%
Applied egg-rr92.8%
clear-num92.8%
un-div-inv92.8%
div-inv92.8%
metadata-eval92.8%
Applied egg-rr92.8%
if 1.66e12 < y Initial program 97.9%
sub-neg97.9%
associate-+l+97.9%
+-commutative97.9%
remove-double-neg97.9%
distribute-frac-neg97.9%
distribute-neg-in97.9%
remove-double-neg97.9%
sub-neg97.9%
neg-mul-197.9%
times-frac97.9%
distribute-frac-neg97.9%
neg-mul-197.9%
*-commutative97.9%
associate-/l*97.9%
*-commutative97.9%
Simplified99.7%
Taylor expanded in t around 0 92.8%
metadata-eval92.8%
cancel-sign-sub-inv92.8%
associate-*r/92.9%
Simplified92.9%
associate-*l/92.8%
Applied egg-rr92.8%
associate-*l/92.9%
clear-num92.8%
*-un-lft-identity92.8%
times-frac92.8%
metadata-eval92.8%
Applied egg-rr92.8%
associate-/r*92.9%
metadata-eval92.9%
Simplified92.9%
Final simplification93.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.9e+26)
(- x (/ y (* 3.0 z)))
(if (<= y 4.2e+22)
(+ x (* (/ t z) (/ 0.3333333333333333 y)))
(- x (/ 0.3333333333333333 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.9e+26) {
tmp = x - (y / (3.0 * z));
} else if (y <= 4.2e+22) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x - (0.3333333333333333 / (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 <= (-3.9d+26)) then
tmp = x - (y / (3.0d0 * z))
else if (y <= 4.2d+22) then
tmp = x + ((t / z) * (0.3333333333333333d0 / y))
else
tmp = x - (0.3333333333333333d0 / (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.9e+26) {
tmp = x - (y / (3.0 * z));
} else if (y <= 4.2e+22) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.9e+26: tmp = x - (y / (3.0 * z)) elif y <= 4.2e+22: tmp = x + ((t / z) * (0.3333333333333333 / y)) else: tmp = x - (0.3333333333333333 / (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.9e+26) tmp = Float64(x - Float64(y / Float64(3.0 * z))); elseif (y <= 4.2e+22) tmp = Float64(x + Float64(Float64(t / z) * Float64(0.3333333333333333 / y))); else tmp = Float64(x - Float64(0.3333333333333333 / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.9e+26) tmp = x - (y / (3.0 * z)); elseif (y <= 4.2e+22) tmp = x + ((t / z) * (0.3333333333333333 / y)); else tmp = x - (0.3333333333333333 / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.9e+26], N[(x - N[(y / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+22], N[(x + N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+26}:\\
\;\;\;\;x - \frac{y}{3 \cdot z}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -3.9e26Initial program 99.9%
sub-neg99.9%
associate-+l+99.9%
+-commutative99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
neg-mul-199.9%
times-frac99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.8%
*-commutative99.8%
Simplified99.7%
Taylor expanded in t around 0 94.6%
metadata-eval94.6%
cancel-sign-sub-inv94.6%
associate-*r/94.6%
Simplified94.6%
associate-*l/94.5%
Applied egg-rr94.5%
*-commutative94.5%
clear-num94.5%
un-div-inv94.6%
div-inv94.7%
metadata-eval94.7%
Applied egg-rr94.7%
if -3.9e26 < y < 4.1999999999999996e22Initial program 92.0%
sub-neg92.0%
associate-+l+92.0%
+-commutative92.0%
remove-double-neg92.0%
distribute-frac-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
sub-neg92.0%
neg-mul-192.0%
times-frac91.8%
distribute-frac-neg91.8%
neg-mul-191.8%
*-commutative91.8%
associate-/l*91.8%
*-commutative91.8%
Simplified91.9%
Taylor expanded in t around inf 87.0%
associate-*r/86.9%
Simplified86.9%
*-commutative86.9%
*-commutative86.9%
times-frac92.8%
Applied egg-rr92.8%
if 4.1999999999999996e22 < y Initial program 97.9%
sub-neg97.9%
associate-+l+97.9%
+-commutative97.9%
remove-double-neg97.9%
distribute-frac-neg97.9%
distribute-neg-in97.9%
remove-double-neg97.9%
sub-neg97.9%
neg-mul-197.9%
times-frac97.9%
distribute-frac-neg97.9%
neg-mul-197.9%
*-commutative97.9%
associate-/l*97.9%
*-commutative97.9%
Simplified99.7%
Taylor expanded in t around 0 92.8%
metadata-eval92.8%
cancel-sign-sub-inv92.8%
associate-*r/92.9%
Simplified92.9%
associate-*l/92.8%
Applied egg-rr92.8%
associate-*l/92.9%
clear-num92.8%
*-un-lft-identity92.8%
times-frac92.8%
metadata-eval92.8%
Applied egg-rr92.8%
associate-/r*92.9%
metadata-eval92.9%
Simplified92.9%
Final simplification93.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.65e+26)
(- x (/ y (* 3.0 z)))
(if (<= y 7.8e+27)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(- x (/ 0.3333333333333333 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.65e+26) {
tmp = x - (y / (3.0 * z));
} else if (y <= 7.8e+27) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - (0.3333333333333333 / (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 <= (-1.65d+26)) then
tmp = x - (y / (3.0d0 * z))
else if (y <= 7.8d+27) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x - (0.3333333333333333d0 / (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.65e+26) {
tmp = x - (y / (3.0 * z));
} else if (y <= 7.8e+27) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - (0.3333333333333333 / (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.65e+26: tmp = x - (y / (3.0 * z)) elif y <= 7.8e+27: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x - (0.3333333333333333 / (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.65e+26) tmp = Float64(x - Float64(y / Float64(3.0 * z))); elseif (y <= 7.8e+27) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x - Float64(0.3333333333333333 / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.65e+26) tmp = x - (y / (3.0 * z)); elseif (y <= 7.8e+27) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x - (0.3333333333333333 / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.65e+26], N[(x - N[(y / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e+27], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+26}:\\
\;\;\;\;x - \frac{y}{3 \cdot z}\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+27}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -1.64999999999999997e26Initial program 99.9%
sub-neg99.9%
associate-+l+99.9%
+-commutative99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
neg-mul-199.9%
times-frac99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.8%
*-commutative99.8%
Simplified99.7%
Taylor expanded in t around 0 94.6%
metadata-eval94.6%
cancel-sign-sub-inv94.6%
associate-*r/94.6%
Simplified94.6%
associate-*l/94.5%
Applied egg-rr94.5%
*-commutative94.5%
clear-num94.5%
un-div-inv94.6%
div-inv94.7%
metadata-eval94.7%
Applied egg-rr94.7%
if -1.64999999999999997e26 < y < 7.7999999999999997e27Initial program 92.0%
sub-neg92.0%
associate-+l+92.0%
+-commutative92.0%
remove-double-neg92.0%
distribute-frac-neg92.0%
distribute-neg-in92.0%
remove-double-neg92.0%
sub-neg92.0%
neg-mul-192.0%
times-frac91.8%
distribute-frac-neg91.8%
neg-mul-191.8%
*-commutative91.8%
associate-/l*91.8%
*-commutative91.8%
Simplified91.9%
Taylor expanded in t around inf 87.0%
if 7.7999999999999997e27 < y Initial program 97.9%
sub-neg97.9%
associate-+l+97.9%
+-commutative97.9%
remove-double-neg97.9%
distribute-frac-neg97.9%
distribute-neg-in97.9%
remove-double-neg97.9%
sub-neg97.9%
neg-mul-197.9%
times-frac97.9%
distribute-frac-neg97.9%
neg-mul-197.9%
*-commutative97.9%
associate-/l*97.9%
*-commutative97.9%
Simplified99.7%
Taylor expanded in t around 0 92.8%
metadata-eval92.8%
cancel-sign-sub-inv92.8%
associate-*r/92.9%
Simplified92.9%
associate-*l/92.8%
Applied egg-rr92.8%
associate-*l/92.9%
clear-num92.8%
*-un-lft-identity92.8%
times-frac92.8%
metadata-eval92.8%
Applied egg-rr92.8%
associate-/r*92.9%
metadata-eval92.9%
Simplified92.9%
Final simplification89.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.9e+93) (not (<= y 9.2e+97))) (* (/ y z) -0.3333333333333333) (+ x (* y (/ 0.3333333333333333 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.9e+93) || !(y <= 9.2e+97)) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x + (y * (0.3333333333333333 / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-3.9d+93)) .or. (.not. (y <= 9.2d+97))) then
tmp = (y / z) * (-0.3333333333333333d0)
else
tmp = x + (y * (0.3333333333333333d0 / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.9e+93) || !(y <= 9.2e+97)) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x + (y * (0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.9e+93) or not (y <= 9.2e+97): tmp = (y / z) * -0.3333333333333333 else: tmp = x + (y * (0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.9e+93) || !(y <= 9.2e+97)) tmp = Float64(Float64(y / z) * -0.3333333333333333); else tmp = Float64(x + Float64(y * Float64(0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.9e+93) || ~((y <= 9.2e+97))) tmp = (y / z) * -0.3333333333333333; else tmp = x + (y * (0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.9e+93], N[Not[LessEqual[y, 9.2e+97]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], N[(x + N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+93} \lor \neg \left(y \leq 9.2 \cdot 10^{+97}\right):\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -3.9000000000000002e93 or 9.20000000000000022e97 < y Initial program 98.7%
sub-neg98.7%
associate-+l+98.7%
+-commutative98.7%
remove-double-neg98.7%
distribute-frac-neg98.7%
distribute-neg-in98.7%
remove-double-neg98.7%
sub-neg98.7%
neg-mul-198.7%
times-frac98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.6%
*-commutative98.6%
Simplified99.7%
Taylor expanded in t around 0 96.5%
metadata-eval96.5%
cancel-sign-sub-inv96.5%
associate-*r/96.6%
Simplified96.6%
associate-*l/96.4%
Applied egg-rr96.4%
Taylor expanded in x around 0 76.0%
if -3.9000000000000002e93 < y < 9.20000000000000022e97Initial program 93.1%
sub-neg93.1%
associate-+l+93.1%
+-commutative93.1%
remove-double-neg93.1%
distribute-frac-neg93.1%
distribute-neg-in93.1%
remove-double-neg93.1%
sub-neg93.1%
neg-mul-193.1%
times-frac93.0%
distribute-frac-neg93.0%
neg-mul-193.0%
*-commutative93.0%
associate-/l*93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in t around 0 44.8%
neg-mul-144.8%
Simplified44.8%
associate-*l/44.8%
clear-num44.8%
add-sqr-sqrt22.4%
sqrt-unprod40.8%
sqr-neg40.8%
sqrt-unprod18.4%
add-sqr-sqrt35.9%
Applied egg-rr35.9%
associate-/r/35.9%
associate-*r*35.9%
associate-*l/35.9%
metadata-eval35.9%
Simplified35.9%
Final simplification49.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8.5e+90) (not (<= y 1.6e+98))) (* (/ y z) -0.3333333333333333) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.5e+90) || !(y <= 1.6e+98)) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-8.5d+90)) .or. (.not. (y <= 1.6d+98))) then
tmp = (y / z) * (-0.3333333333333333d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.5e+90) || !(y <= 1.6e+98)) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8.5e+90) or not (y <= 1.6e+98): tmp = (y / z) * -0.3333333333333333 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8.5e+90) || !(y <= 1.6e+98)) tmp = Float64(Float64(y / z) * -0.3333333333333333); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -8.5e+90) || ~((y <= 1.6e+98))) tmp = (y / z) * -0.3333333333333333; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8.5e+90], N[Not[LessEqual[y, 1.6e+98]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+90} \lor \neg \left(y \leq 1.6 \cdot 10^{+98}\right):\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -8.5000000000000002e90 or 1.6000000000000001e98 < y Initial program 98.7%
sub-neg98.7%
associate-+l+98.7%
+-commutative98.7%
remove-double-neg98.7%
distribute-frac-neg98.7%
distribute-neg-in98.7%
remove-double-neg98.7%
sub-neg98.7%
neg-mul-198.7%
times-frac98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.6%
*-commutative98.6%
Simplified99.7%
Taylor expanded in t around 0 96.5%
metadata-eval96.5%
cancel-sign-sub-inv96.5%
associate-*r/96.6%
Simplified96.6%
associate-*l/96.4%
Applied egg-rr96.4%
Taylor expanded in x around 0 76.0%
if -8.5000000000000002e90 < y < 1.6000000000000001e98Initial program 93.1%
sub-neg93.1%
associate-+l+93.1%
+-commutative93.1%
remove-double-neg93.1%
distribute-frac-neg93.1%
distribute-neg-in93.1%
remove-double-neg93.1%
sub-neg93.1%
neg-mul-193.1%
times-frac93.0%
distribute-frac-neg93.0%
neg-mul-193.0%
*-commutative93.0%
associate-/l*93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in x around inf 35.8%
Final simplification49.3%
(FPCore (x y z t) :precision binary64 (+ x (* 0.3333333333333333 (/ (- (/ t y) y) z))))
double code(double x, double y, double z, double t) {
return x + (0.3333333333333333 * (((t / y) - y) / z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (0.3333333333333333d0 * (((t / y) - y) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (0.3333333333333333 * (((t / y) - y) / z));
}
def code(x, y, z, t): return x + (0.3333333333333333 * (((t / y) - y) / z))
function code(x, y, z, t) return Float64(x + Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z))) end
function tmp = code(x, y, z, t) tmp = x + (0.3333333333333333 * (((t / y) - y) / z)); end
code[x_, y_, z_, t_] := N[(x + N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}
\end{array}
Initial program 95.0%
sub-neg95.0%
associate-+l+95.0%
+-commutative95.0%
remove-double-neg95.0%
distribute-frac-neg95.0%
distribute-neg-in95.0%
remove-double-neg95.0%
sub-neg95.0%
neg-mul-195.0%
times-frac94.9%
distribute-frac-neg94.9%
neg-mul-194.9%
*-commutative94.9%
associate-/l*94.9%
*-commutative94.9%
Simplified95.3%
Taylor expanded in z around 0 95.3%
(FPCore (x y z t) :precision binary64 (- x (/ y (* 3.0 z))))
double code(double x, double y, double z, double t) {
return x - (y / (3.0 * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x - (y / (3.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return x - (y / (3.0 * z));
}
def code(x, y, z, t): return x - (y / (3.0 * z))
function code(x, y, z, t) return Float64(x - Float64(y / Float64(3.0 * z))) end
function tmp = code(x, y, z, t) tmp = x - (y / (3.0 * z)); end
code[x_, y_, z_, t_] := N[(x - N[(y / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{3 \cdot z}
\end{array}
Initial program 95.0%
sub-neg95.0%
associate-+l+95.0%
+-commutative95.0%
remove-double-neg95.0%
distribute-frac-neg95.0%
distribute-neg-in95.0%
remove-double-neg95.0%
sub-neg95.0%
neg-mul-195.0%
times-frac94.9%
distribute-frac-neg94.9%
neg-mul-194.9%
*-commutative94.9%
associate-/l*94.9%
*-commutative94.9%
Simplified95.3%
Taylor expanded in t around 0 62.2%
metadata-eval62.2%
cancel-sign-sub-inv62.2%
associate-*r/62.2%
Simplified62.2%
associate-*l/62.2%
Applied egg-rr62.2%
*-commutative62.2%
clear-num62.2%
un-div-inv62.2%
div-inv62.2%
metadata-eval62.2%
Applied egg-rr62.2%
Final simplification62.2%
(FPCore (x y z t) :precision binary64 (- x (/ 0.3333333333333333 (/ z y))))
double code(double x, double y, double z, double t) {
return x - (0.3333333333333333 / (z / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x - (0.3333333333333333d0 / (z / y))
end function
public static double code(double x, double y, double z, double t) {
return x - (0.3333333333333333 / (z / y));
}
def code(x, y, z, t): return x - (0.3333333333333333 / (z / y))
function code(x, y, z, t) return Float64(x - Float64(0.3333333333333333 / Float64(z / y))) end
function tmp = code(x, y, z, t) tmp = x - (0.3333333333333333 / (z / y)); end
code[x_, y_, z_, t_] := N[(x - N[(0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{0.3333333333333333}{\frac{z}{y}}
\end{array}
Initial program 95.0%
sub-neg95.0%
associate-+l+95.0%
+-commutative95.0%
remove-double-neg95.0%
distribute-frac-neg95.0%
distribute-neg-in95.0%
remove-double-neg95.0%
sub-neg95.0%
neg-mul-195.0%
times-frac94.9%
distribute-frac-neg94.9%
neg-mul-194.9%
*-commutative94.9%
associate-/l*94.9%
*-commutative94.9%
Simplified95.3%
Taylor expanded in t around 0 62.2%
metadata-eval62.2%
cancel-sign-sub-inv62.2%
associate-*r/62.2%
Simplified62.2%
associate-*l/62.2%
Applied egg-rr62.2%
associate-*l/62.2%
clear-num62.2%
*-un-lft-identity62.2%
times-frac62.2%
metadata-eval62.2%
Applied egg-rr62.2%
associate-/r*62.2%
metadata-eval62.2%
Simplified62.2%
(FPCore (x y z t) :precision binary64 (- x (* 0.3333333333333333 (/ y z))))
double code(double x, double y, double z, double t) {
return x - (0.3333333333333333 * (y / z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x - (0.3333333333333333d0 * (y / z))
end function
public static double code(double x, double y, double z, double t) {
return x - (0.3333333333333333 * (y / z));
}
def code(x, y, z, t): return x - (0.3333333333333333 * (y / z))
function code(x, y, z, t) return Float64(x - Float64(0.3333333333333333 * Float64(y / z))) end
function tmp = code(x, y, z, t) tmp = x - (0.3333333333333333 * (y / z)); end
code[x_, y_, z_, t_] := N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - 0.3333333333333333 \cdot \frac{y}{z}
\end{array}
Initial program 95.0%
Taylor expanded in t around 0 62.2%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.0%
sub-neg95.0%
associate-+l+95.0%
+-commutative95.0%
remove-double-neg95.0%
distribute-frac-neg95.0%
distribute-neg-in95.0%
remove-double-neg95.0%
sub-neg95.0%
neg-mul-195.0%
times-frac94.9%
distribute-frac-neg94.9%
neg-mul-194.9%
*-commutative94.9%
associate-/l*94.9%
*-commutative94.9%
Simplified95.3%
Taylor expanded in x around inf 31.1%
(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 2024112
(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))))