
(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 9 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 (<= (* z 3.0) -5e-104) (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))) (+ x (/ (* -0.3333333333333333 (- y (/ t y))) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -5e-104) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z * 3.0d0) <= (-5d-104)) then
tmp = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
else
tmp = x + (((-0.3333333333333333d0) * (y - (t / 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) <= -5e-104) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -5e-104: tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)) else: tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -5e-104) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = Float64(x + Float64(Float64(-0.3333333333333333 * Float64(y - Float64(t / y))) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -5e-104) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); else tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -5e-104], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.3333333333333333 * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -5 \cdot 10^{-104}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}\\
\end{array}
\end{array}
if (*.f64 z 3) < -4.99999999999999979e-104Initial program 98.8%
if -4.99999999999999979e-104 < (*.f64 z 3) Initial program 91.9%
associate-+l-91.9%
sub-neg91.9%
sub-neg91.9%
distribute-neg-in91.9%
unsub-neg91.9%
neg-mul-191.9%
associate-*r/91.9%
associate-*l/91.9%
distribute-neg-frac91.9%
neg-mul-191.9%
times-frac99.1%
distribute-lft-out--99.1%
*-commutative99.1%
associate-/r*99.1%
metadata-eval99.1%
Simplified99.1%
associate-*l/99.2%
Applied egg-rr99.2%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.4e+46) (not (<= y 1.95e+31))) (+ x (/ y (* z -3.0))) (+ x (* 0.3333333333333333 (/ (/ t z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.4e+46) || !(y <= 1.95e+31)) {
tmp = x + (y / (z * -3.0));
} else {
tmp = x + (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 <= (-1.4d+46)) .or. (.not. (y <= 1.95d+31))) then
tmp = x + (y / (z * (-3.0d0)))
else
tmp = x + (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 <= -1.4e+46) || !(y <= 1.95e+31)) {
tmp = x + (y / (z * -3.0));
} else {
tmp = x + (0.3333333333333333 * ((t / z) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.4e+46) or not (y <= 1.95e+31): tmp = x + (y / (z * -3.0)) else: tmp = x + (0.3333333333333333 * ((t / z) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.4e+46) || !(y <= 1.95e+31)) tmp = Float64(x + Float64(y / Float64(z * -3.0))); else tmp = Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.4e+46) || ~((y <= 1.95e+31))) tmp = x + (y / (z * -3.0)); else tmp = x + (0.3333333333333333 * ((t / z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.4e+46], N[Not[LessEqual[y, 1.95e+31]], $MachinePrecision]], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+46} \lor \neg \left(y \leq 1.95 \cdot 10^{+31}\right):\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\
\end{array}
\end{array}
if y < -1.40000000000000009e46 or 1.95e31 < y Initial program 97.2%
associate-+l-97.2%
sub-neg97.2%
sub-neg97.2%
distribute-neg-in97.2%
unsub-neg97.2%
neg-mul-197.2%
associate-*r/97.2%
associate-*l/97.1%
distribute-neg-frac97.1%
neg-mul-197.1%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 94.6%
associate-*r/94.7%
*-commutative94.7%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around 0 94.7%
*-commutative94.7%
Simplified94.7%
if -1.40000000000000009e46 < y < 1.95e31Initial program 92.3%
associate-+l-92.3%
sub-neg92.3%
sub-neg92.3%
distribute-neg-in92.3%
unsub-neg92.3%
neg-mul-192.3%
associate-*r/92.3%
associate-*l/92.2%
distribute-neg-frac92.2%
neg-mul-192.2%
times-frac92.5%
distribute-lft-out--92.5%
*-commutative92.5%
associate-/r*92.6%
metadata-eval92.6%
Simplified92.6%
Taylor expanded in y around 0 88.9%
associate-*r/88.9%
Simplified88.9%
*-commutative88.9%
*-commutative88.9%
times-frac93.5%
clear-num93.5%
div-inv93.5%
associate-/l*93.5%
*-commutative93.5%
*-un-lft-identity93.5%
times-frac93.0%
metadata-eval93.0%
Applied egg-rr93.0%
Final simplification93.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2e+47) (not (<= y 1.15e+31))) (+ x (/ y (* z -3.0))) (+ x (* (/ t z) (/ 0.3333333333333333 y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2e+47) || !(y <= 1.15e+31)) {
tmp = x + (y / (z * -3.0));
} else {
tmp = x + ((t / z) * (0.3333333333333333 / y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2d+47)) .or. (.not. (y <= 1.15d+31))) then
tmp = x + (y / (z * (-3.0d0)))
else
tmp = x + ((t / z) * (0.3333333333333333d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2e+47) || !(y <= 1.15e+31)) {
tmp = x + (y / (z * -3.0));
} else {
tmp = x + ((t / z) * (0.3333333333333333 / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2e+47) or not (y <= 1.15e+31): tmp = x + (y / (z * -3.0)) else: tmp = x + ((t / z) * (0.3333333333333333 / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2e+47) || !(y <= 1.15e+31)) tmp = Float64(x + Float64(y / Float64(z * -3.0))); else tmp = Float64(x + Float64(Float64(t / z) * Float64(0.3333333333333333 / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2e+47) || ~((y <= 1.15e+31))) tmp = x + (y / (z * -3.0)); else tmp = x + ((t / z) * (0.3333333333333333 / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2e+47], N[Not[LessEqual[y, 1.15e+31]], $MachinePrecision]], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+47} \lor \neg \left(y \leq 1.15 \cdot 10^{+31}\right):\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\end{array}
\end{array}
if y < -2.0000000000000001e47 or 1.15e31 < y Initial program 97.2%
associate-+l-97.2%
sub-neg97.2%
sub-neg97.2%
distribute-neg-in97.2%
unsub-neg97.2%
neg-mul-197.2%
associate-*r/97.2%
associate-*l/97.1%
distribute-neg-frac97.1%
neg-mul-197.1%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
associate-*l/99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 94.6%
associate-*r/94.7%
*-commutative94.7%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around 0 94.7%
*-commutative94.7%
Simplified94.7%
if -2.0000000000000001e47 < y < 1.15e31Initial program 92.3%
associate-+l-92.3%
sub-neg92.3%
sub-neg92.3%
distribute-neg-in92.3%
unsub-neg92.3%
neg-mul-192.3%
associate-*r/92.3%
associate-*l/92.2%
distribute-neg-frac92.2%
neg-mul-192.2%
times-frac92.5%
distribute-lft-out--92.5%
*-commutative92.5%
associate-/r*92.6%
metadata-eval92.6%
Simplified92.6%
Taylor expanded in y around 0 88.9%
associate-*r/88.9%
Simplified88.9%
*-commutative88.9%
*-commutative88.9%
times-frac93.5%
Applied egg-rr93.5%
Final simplification94.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.2e+244) (+ x (/ t (* 3.0 (* z y)))) (+ x (* (- y (/ t y)) (/ -0.3333333333333333 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.2e+244) {
tmp = x + (t / (3.0 * (z * y)));
} else {
tmp = x + ((y - (t / 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 (z <= (-1.2d+244)) then
tmp = x + (t / (3.0d0 * (z * y)))
else
tmp = x + ((y - (t / 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 (z <= -1.2e+244) {
tmp = x + (t / (3.0 * (z * y)));
} else {
tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.2e+244: tmp = x + (t / (3.0 * (z * y))) else: tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.2e+244) tmp = Float64(x + Float64(t / Float64(3.0 * Float64(z * y)))); else tmp = Float64(x + Float64(Float64(y - Float64(t / y)) * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.2e+244) tmp = x + (t / (3.0 * (z * y))); else tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.2e+244], N[(x + N[(t / N[(3.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+244}:\\
\;\;\;\;x + \frac{t}{3 \cdot \left(z \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if z < -1.19999999999999994e244Initial 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.8%
distribute-neg-frac99.8%
neg-mul-199.8%
times-frac67.8%
distribute-lft-out--67.8%
*-commutative67.8%
associate-/r*68.0%
metadata-eval68.0%
Simplified68.0%
Taylor expanded in y around 0 95.2%
associate-*r/95.2%
Simplified95.2%
*-commutative95.2%
*-commutative95.2%
times-frac90.7%
Applied egg-rr90.7%
*-commutative90.7%
clear-num90.6%
frac-times95.2%
*-un-lft-identity95.2%
Applied egg-rr95.2%
Taylor expanded in y around 0 95.3%
if -1.19999999999999994e244 < z Initial program 93.9%
associate-+l-93.9%
sub-neg93.9%
sub-neg93.9%
distribute-neg-in93.9%
unsub-neg93.9%
neg-mul-193.9%
associate-*r/93.9%
associate-*l/93.8%
distribute-neg-frac93.8%
neg-mul-193.8%
times-frac98.1%
distribute-lft-out--98.1%
*-commutative98.1%
associate-/r*98.1%
metadata-eval98.1%
Simplified98.1%
Final simplification97.9%
(FPCore (x y z t) :precision binary64 (if (<= z -6.4e+243) (+ x (/ t (* 3.0 (* z y)))) (+ x (/ (* -0.3333333333333333 (- y (/ t y))) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.4e+243) {
tmp = x + (t / (3.0 * (z * y)));
} else {
tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-6.4d+243)) then
tmp = x + (t / (3.0d0 * (z * y)))
else
tmp = x + (((-0.3333333333333333d0) * (y - (t / y))) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.4e+243) {
tmp = x + (t / (3.0 * (z * y)));
} else {
tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.4e+243: tmp = x + (t / (3.0 * (z * y))) else: tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.4e+243) tmp = Float64(x + Float64(t / Float64(3.0 * Float64(z * y)))); else tmp = Float64(x + Float64(Float64(-0.3333333333333333 * Float64(y - Float64(t / y))) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.4e+243) tmp = x + (t / (3.0 * (z * y))); else tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.4e+243], N[(x + N[(t / N[(3.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.3333333333333333 * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+243}:\\
\;\;\;\;x + \frac{t}{3 \cdot \left(z \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}\\
\end{array}
\end{array}
if z < -6.40000000000000033e243Initial 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.8%
distribute-neg-frac99.8%
neg-mul-199.8%
times-frac67.8%
distribute-lft-out--67.8%
*-commutative67.8%
associate-/r*68.0%
metadata-eval68.0%
Simplified68.0%
Taylor expanded in y around 0 95.2%
associate-*r/95.2%
Simplified95.2%
*-commutative95.2%
*-commutative95.2%
times-frac90.7%
Applied egg-rr90.7%
*-commutative90.7%
clear-num90.6%
frac-times95.2%
*-un-lft-identity95.2%
Applied egg-rr95.2%
Taylor expanded in y around 0 95.3%
if -6.40000000000000033e243 < z Initial program 93.9%
associate-+l-93.9%
sub-neg93.9%
sub-neg93.9%
distribute-neg-in93.9%
unsub-neg93.9%
neg-mul-193.9%
associate-*r/93.9%
associate-*l/93.8%
distribute-neg-frac93.8%
neg-mul-193.8%
times-frac98.1%
distribute-lft-out--98.1%
*-commutative98.1%
associate-/r*98.1%
metadata-eval98.1%
Simplified98.1%
associate-*l/98.2%
Applied egg-rr98.2%
Final simplification97.9%
(FPCore (x y z t) :precision binary64 (+ x (* y (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + (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 * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (y * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + (y * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(y * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + (y * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 94.4%
associate-+l-94.4%
sub-neg94.4%
sub-neg94.4%
distribute-neg-in94.4%
unsub-neg94.4%
neg-mul-194.4%
associate-*r/94.4%
associate-*l/94.3%
distribute-neg-frac94.3%
neg-mul-194.3%
times-frac95.6%
distribute-lft-out--95.6%
*-commutative95.6%
associate-/r*95.6%
metadata-eval95.6%
Simplified95.6%
associate-*l/95.7%
Applied egg-rr95.7%
Taylor expanded in y around inf 64.1%
associate-*r/64.1%
associate-/l*64.1%
Simplified64.1%
associate-/r/64.0%
Applied egg-rr64.0%
Final simplification64.0%
(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 94.4%
associate-+l-94.4%
sub-neg94.4%
sub-neg94.4%
distribute-neg-in94.4%
unsub-neg94.4%
neg-mul-194.4%
associate-*r/94.4%
associate-*l/94.3%
distribute-neg-frac94.3%
neg-mul-194.3%
times-frac95.6%
distribute-lft-out--95.6%
*-commutative95.6%
associate-/r*95.6%
metadata-eval95.6%
Simplified95.6%
associate-*l/95.7%
Applied egg-rr95.7%
Taylor expanded in y around inf 64.1%
associate-*r/64.1%
associate-/l*64.1%
Simplified64.1%
Final simplification64.1%
(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 94.4%
associate-+l-94.4%
sub-neg94.4%
sub-neg94.4%
distribute-neg-in94.4%
unsub-neg94.4%
neg-mul-194.4%
associate-*r/94.4%
associate-*l/94.3%
distribute-neg-frac94.3%
neg-mul-194.3%
times-frac95.6%
distribute-lft-out--95.6%
*-commutative95.6%
associate-/r*95.6%
metadata-eval95.6%
Simplified95.6%
associate-*l/95.7%
Applied egg-rr95.7%
Taylor expanded in y around inf 64.1%
associate-*r/64.1%
*-commutative64.1%
associate-/l*64.1%
Simplified64.1%
Taylor expanded in z around 0 64.1%
*-commutative64.1%
Simplified64.1%
Final simplification64.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 94.4%
associate-+l-94.4%
sub-neg94.4%
sub-neg94.4%
distribute-neg-in94.4%
unsub-neg94.4%
neg-mul-194.4%
associate-*r/94.4%
associate-*l/94.3%
distribute-neg-frac94.3%
neg-mul-194.3%
times-frac95.6%
distribute-lft-out--95.6%
*-commutative95.6%
associate-/r*95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in x around inf 32.7%
Final simplification32.7%
(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 2023207
(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))))