
(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 12 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 4e-30) (+ x (/ (* -0.3333333333333333 (- y (/ t y))) z)) (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4e-30) {
tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z);
} else {
tmp = (x - (y / (z * 3.0))) + (t / (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 (t <= 4d-30) then
tmp = x + (((-0.3333333333333333d0) * (y - (t / y))) / z)
else
tmp = (x - (y / (z * 3.0d0))) + (t / (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 (t <= 4e-30) {
tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z);
} else {
tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 4e-30: tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z) else: tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 4e-30) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * Float64(y - Float64(t / y))) / z)); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 4e-30) tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z); else tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 4e-30], N[(x + N[(N[(-0.3333333333333333 * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4 \cdot 10^{-30}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\end{array}
\end{array}
if t < 4e-30Initial program 94.7%
associate-+l-94.7%
sub-neg94.7%
sub-neg94.7%
distribute-neg-in94.7%
unsub-neg94.7%
neg-mul-194.7%
associate-*r/94.7%
associate-*l/94.7%
distribute-neg-frac94.7%
neg-mul-194.7%
times-frac97.8%
distribute-lft-out--97.8%
*-commutative97.8%
associate-/r*97.7%
metadata-eval97.7%
Simplified97.7%
associate-*l/97.8%
Applied egg-rr97.8%
if 4e-30 < t Initial program 99.9%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -8.2e+79)
(+ x (/ (/ y z) -3.0))
(if (<= y 3.9e-84)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(+ x (/ (* -0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e+79) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 3.9e-84) {
tmp = x + (0.3333333333333333 * (t / (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 (y <= (-8.2d+79)) then
tmp = x + ((y / z) / (-3.0d0))
else if (y <= 3.9d-84) then
tmp = x + (0.3333333333333333d0 * (t / (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 (y <= -8.2e+79) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 3.9e-84) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + ((-0.3333333333333333 * y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.2e+79: tmp = x + ((y / z) / -3.0) elif y <= 3.9e-84: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x + ((-0.3333333333333333 * y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.2e+79) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); elseif (y <= 3.9e-84) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.2e+79) tmp = x + ((y / z) / -3.0); elseif (y <= 3.9e-84) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x + ((-0.3333333333333333 * y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.2e+79], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-84], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+79}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-84}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -8.2e79Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
unsub-neg99.8%
neg-mul-199.8%
associate-*r/99.8%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 94.2%
metadata-eval94.2%
times-frac94.3%
*-un-lft-identity94.3%
*-commutative94.3%
associate-/r*94.3%
Applied egg-rr94.3%
if -8.2e79 < y < 3.90000000000000023e-84Initial program 93.6%
associate-+l-93.6%
sub-neg93.6%
sub-neg93.6%
distribute-neg-in93.6%
unsub-neg93.6%
neg-mul-193.6%
associate-*r/93.6%
associate-*l/93.6%
distribute-neg-frac93.6%
neg-mul-193.6%
times-frac93.5%
distribute-lft-out--93.5%
*-commutative93.5%
associate-/r*93.3%
metadata-eval93.3%
Simplified93.3%
Taylor expanded in y around 0 92.1%
if 3.90000000000000023e-84 < y Initial program 98.4%
associate-+l-98.4%
sub-neg98.4%
sub-neg98.4%
distribute-neg-in98.4%
unsub-neg98.4%
neg-mul-198.4%
associate-*r/98.4%
associate-*l/98.4%
distribute-neg-frac98.4%
neg-mul-198.4%
times-frac99.8%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 97.8%
*-commutative97.8%
Simplified97.8%
Final simplification94.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -7.8e+79)
(+ x (/ (/ y z) -3.0))
(if (<= y 3.9e-84)
(+ x (* t (/ 0.3333333333333333 (* y z))))
(+ x (/ (* -0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.8e+79) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 3.9e-84) {
tmp = x + (t * (0.3333333333333333 / (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 (y <= (-7.8d+79)) then
tmp = x + ((y / z) / (-3.0d0))
else if (y <= 3.9d-84) then
tmp = x + (t * (0.3333333333333333d0 / (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 (y <= -7.8e+79) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 3.9e-84) {
tmp = x + (t * (0.3333333333333333 / (y * z)));
} else {
tmp = x + ((-0.3333333333333333 * y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.8e+79: tmp = x + ((y / z) / -3.0) elif y <= 3.9e-84: tmp = x + (t * (0.3333333333333333 / (y * z))) else: tmp = x + ((-0.3333333333333333 * y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.8e+79) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); elseif (y <= 3.9e-84) tmp = Float64(x + Float64(t * Float64(0.3333333333333333 / Float64(y * z)))); else tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.8e+79) tmp = x + ((y / z) / -3.0); elseif (y <= 3.9e-84) tmp = x + (t * (0.3333333333333333 / (y * z))); else tmp = x + ((-0.3333333333333333 * y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.8e+79], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-84], N[(x + N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+79}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-84}:\\
\;\;\;\;x + t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -7.7999999999999994e79Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
unsub-neg99.8%
neg-mul-199.8%
associate-*r/99.8%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 94.2%
metadata-eval94.2%
times-frac94.3%
*-un-lft-identity94.3%
*-commutative94.3%
associate-/r*94.3%
Applied egg-rr94.3%
if -7.7999999999999994e79 < y < 3.90000000000000023e-84Initial program 93.6%
associate-+l-93.6%
sub-neg93.6%
sub-neg93.6%
distribute-neg-in93.6%
unsub-neg93.6%
neg-mul-193.6%
associate-*r/93.6%
associate-*l/93.6%
distribute-neg-frac93.6%
neg-mul-193.6%
times-frac93.5%
distribute-lft-out--93.5%
*-commutative93.5%
associate-/r*93.3%
metadata-eval93.3%
Simplified93.3%
associate-*l/93.4%
Applied egg-rr93.4%
Taylor expanded in y around 0 92.1%
associate-*r/92.1%
*-rgt-identity92.1%
times-frac92.1%
/-rgt-identity92.1%
Simplified92.1%
if 3.90000000000000023e-84 < y Initial program 98.4%
associate-+l-98.4%
sub-neg98.4%
sub-neg98.4%
distribute-neg-in98.4%
unsub-neg98.4%
neg-mul-198.4%
associate-*r/98.4%
associate-*l/98.4%
distribute-neg-frac98.4%
neg-mul-198.4%
times-frac99.8%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 97.8%
*-commutative97.8%
Simplified97.8%
Final simplification94.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.65e+81)
(+ x (/ (/ y z) -3.0))
(if (<= y 3.9e-84)
(+ x (/ (/ (* t 0.3333333333333333) z) y))
(+ x (/ (* -0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.65e+81) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 3.9e-84) {
tmp = x + (((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 <= (-1.65d+81)) then
tmp = x + ((y / z) / (-3.0d0))
else if (y <= 3.9d-84) then
tmp = x + (((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 <= -1.65e+81) {
tmp = x + ((y / z) / -3.0);
} else if (y <= 3.9e-84) {
tmp = x + (((t * 0.3333333333333333) / z) / y);
} else {
tmp = x + ((-0.3333333333333333 * y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.65e+81: tmp = x + ((y / z) / -3.0) elif y <= 3.9e-84: tmp = x + (((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 <= -1.65e+81) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); elseif (y <= 3.9e-84) tmp = Float64(x + Float64(Float64(Float64(t * 0.3333333333333333) / z) / y)); else tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.65e+81) tmp = x + ((y / z) / -3.0); elseif (y <= 3.9e-84) tmp = x + (((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, -1.65e+81], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-84], N[(x + N[(N[(N[(t * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+81}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-84}:\\
\;\;\;\;x + \frac{\frac{t \cdot 0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -1.65e81Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
unsub-neg99.8%
neg-mul-199.8%
associate-*r/99.8%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 94.2%
metadata-eval94.2%
times-frac94.3%
*-un-lft-identity94.3%
*-commutative94.3%
associate-/r*94.3%
Applied egg-rr94.3%
if -1.65e81 < y < 3.90000000000000023e-84Initial program 93.6%
associate-+l-93.6%
sub-neg93.6%
sub-neg93.6%
distribute-neg-in93.6%
unsub-neg93.6%
neg-mul-193.6%
associate-*r/93.6%
associate-*l/93.6%
distribute-neg-frac93.6%
neg-mul-193.6%
times-frac93.5%
distribute-lft-out--93.5%
*-commutative93.5%
associate-/r*93.3%
metadata-eval93.3%
Simplified93.3%
Taylor expanded in y around 0 92.1%
associate-*r/92.1%
*-commutative92.1%
associate-/r*96.3%
*-commutative96.3%
Applied egg-rr96.3%
if 3.90000000000000023e-84 < y Initial program 98.4%
associate-+l-98.4%
sub-neg98.4%
sub-neg98.4%
distribute-neg-in98.4%
unsub-neg98.4%
neg-mul-198.4%
associate-*r/98.4%
associate-*l/98.4%
distribute-neg-frac98.4%
neg-mul-198.4%
times-frac99.8%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 97.8%
*-commutative97.8%
Simplified97.8%
Final simplification96.3%
(FPCore (x y z t) :precision binary64 (+ x (* -0.3333333333333333 (/ (- y (/ t y)) z))))
double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 * ((y - (t / 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 - (t / y)) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 * ((y - (t / y)) / z));
}
def code(x, y, z, t): return x + (-0.3333333333333333 * ((y - (t / y)) / z))
function code(x, y, z, t) return Float64(x + Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z))) end
function tmp = code(x, y, z, t) tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z)); end
code[x_, y_, z_, t_] := N[(x + N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + -0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}
\end{array}
Initial program 96.1%
associate-+l-96.1%
sub-neg96.1%
sub-neg96.1%
distribute-neg-in96.1%
unsub-neg96.1%
neg-mul-196.1%
associate-*r/96.1%
associate-*l/96.1%
distribute-neg-frac96.1%
neg-mul-196.1%
times-frac96.4%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in z around 0 96.2%
Final simplification96.2%
(FPCore (x y z t) :precision binary64 (+ x (* (- y (/ t y)) (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) * (-0.3333333333333333 / z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - (t / y)) * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + ((y - (t / y)) * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - Float64(t / y)) * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 96.1%
associate-+l-96.1%
sub-neg96.1%
sub-neg96.1%
distribute-neg-in96.1%
unsub-neg96.1%
neg-mul-196.1%
associate-*r/96.1%
associate-*l/96.1%
distribute-neg-frac96.1%
neg-mul-196.1%
times-frac96.4%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Final simplification96.4%
(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(-0.3333333333333333 / Float64(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[(-0.3333333333333333 / N[(z / N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333}{\frac{z}{y - \frac{t}{y}}}
\end{array}
Initial program 96.1%
associate-+l-96.1%
sub-neg96.1%
sub-neg96.1%
distribute-neg-in96.1%
unsub-neg96.1%
neg-mul-196.1%
associate-*r/96.1%
associate-*l/96.1%
distribute-neg-frac96.1%
neg-mul-196.1%
times-frac96.4%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
associate-*l/96.5%
associate-/l*96.4%
Applied egg-rr96.4%
Final simplification96.4%
(FPCore (x y z t) :precision binary64 (+ x (/ (* -0.3333333333333333 (- y (/ t y))) z)))
double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * (y - (t / 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 - (t / y))) / z)
end function
public static double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * (y - (t / y))) / z);
}
def code(x, y, z, t): return x + ((-0.3333333333333333 * (y - (t / y))) / z)
function code(x, y, z, t) return Float64(x + Float64(Float64(-0.3333333333333333 * Float64(y - Float64(t / y))) / z)) end
function tmp = code(x, y, z, t) tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z); end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}
\end{array}
Initial program 96.1%
associate-+l-96.1%
sub-neg96.1%
sub-neg96.1%
distribute-neg-in96.1%
unsub-neg96.1%
neg-mul-196.1%
associate-*r/96.1%
associate-*l/96.1%
distribute-neg-frac96.1%
neg-mul-196.1%
times-frac96.4%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
associate-*l/96.5%
Applied egg-rr96.5%
Final simplification96.5%
(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 96.1%
associate-+l-96.1%
sub-neg96.1%
sub-neg96.1%
distribute-neg-in96.1%
unsub-neg96.1%
neg-mul-196.1%
associate-*r/96.1%
associate-*l/96.1%
distribute-neg-frac96.1%
neg-mul-196.1%
times-frac96.4%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in y around inf 65.5%
Final simplification65.5%
(FPCore (x y z t) :precision binary64 (+ x (/ y (* z -3.0))))
double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (y / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return x + (y / (z * -3.0));
}
def code(x, y, z, t): return x + (y / (z * -3.0))
function code(x, y, z, t) return Float64(x + Float64(y / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = x + (y / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{z \cdot -3}
\end{array}
Initial program 96.1%
associate-+l-96.1%
sub-neg96.1%
sub-neg96.1%
distribute-neg-in96.1%
unsub-neg96.1%
neg-mul-196.1%
associate-*r/96.1%
associate-*l/96.1%
distribute-neg-frac96.1%
neg-mul-196.1%
times-frac96.4%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in y around inf 65.5%
metadata-eval65.5%
times-frac65.5%
*-un-lft-identity65.5%
*-commutative65.5%
Applied egg-rr65.5%
Final simplification65.5%
(FPCore (x y z t) :precision binary64 (+ x (/ (* -0.3333333333333333 y) z)))
double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * y) / z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (((-0.3333333333333333d0) * y) / z)
end function
public static double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * y) / z);
}
def code(x, y, z, t): return x + ((-0.3333333333333333 * y) / z)
function code(x, y, z, t) return Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)) end
function tmp = code(x, y, z, t) tmp = x + ((-0.3333333333333333 * y) / z); end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333 \cdot y}{z}
\end{array}
Initial program 96.1%
associate-+l-96.1%
sub-neg96.1%
sub-neg96.1%
distribute-neg-in96.1%
unsub-neg96.1%
neg-mul-196.1%
associate-*r/96.1%
associate-*l/96.1%
distribute-neg-frac96.1%
neg-mul-196.1%
times-frac96.4%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
associate-*l/96.5%
Applied egg-rr96.5%
Taylor expanded in y around inf 65.5%
*-commutative65.5%
Simplified65.5%
Final simplification65.5%
(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(Float64(y / -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[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{y}{-3}}{z}
\end{array}
Initial program 96.1%
associate-+l-96.1%
sub-neg96.1%
sub-neg96.1%
distribute-neg-in96.1%
unsub-neg96.1%
neg-mul-196.1%
associate-*r/96.1%
associate-*l/96.1%
distribute-neg-frac96.1%
neg-mul-196.1%
times-frac96.4%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
associate-*l/96.5%
Applied egg-rr96.5%
Taylor expanded in y around inf 65.5%
/-rgt-identity65.5%
*-commutative65.5%
associate-/l*65.5%
metadata-eval65.5%
Simplified65.5%
Final simplification65.5%
(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 2023217
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))