
(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 10 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 (+ x (/ (- y (/ t y)) (* z -3.0))))
double code(double x, double y, double z, double t) {
return x + ((y - (t / 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 - (t / y)) / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) / (z * -3.0));
}
def code(x, y, z, t): return x + ((y - (t / y)) / (z * -3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - Float64(t / y)) / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = x + ((y - (t / y)) / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - \frac{t}{y}}{z \cdot -3}
\end{array}
Initial program 95.9%
associate-+l-95.9%
sub-neg95.9%
sub-neg95.9%
distribute-neg-in95.9%
unsub-neg95.9%
neg-mul-195.9%
associate-*r/95.9%
associate-*l/95.8%
distribute-neg-frac95.8%
neg-mul-195.8%
times-frac96.5%
distribute-lft-out--97.2%
*-commutative97.2%
associate-/r*97.2%
metadata-eval97.2%
Simplified97.2%
*-commutative97.2%
clear-num97.2%
un-div-inv97.2%
div-inv97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Final simplification97.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.9e-6) (not (<= y 1.1e-58))) (- x (/ y (* z 3.0))) (+ x (* (/ t y) (/ 0.3333333333333333 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.9e-6) || !(y <= 1.1e-58)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x + ((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 ((y <= (-6.9d-6)) .or. (.not. (y <= 1.1d-58))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = x + ((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 ((y <= -6.9e-6) || !(y <= 1.1e-58)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x + ((t / y) * (0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.9e-6) or not (y <= 1.1e-58): tmp = x - (y / (z * 3.0)) else: tmp = x + ((t / y) * (0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.9e-6) || !(y <= 1.1e-58)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(x + Float64(Float64(t / y) * Float64(0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.9e-6) || ~((y <= 1.1e-58))) tmp = x - (y / (z * 3.0)); else tmp = x + ((t / y) * (0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.9e-6], N[Not[LessEqual[y, 1.1e-58]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.9 \cdot 10^{-6} \lor \neg \left(y \leq 1.1 \cdot 10^{-58}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -6.9e-6 or 1.10000000000000003e-58 < y Initial program 97.7%
Taylor expanded in t around 0 90.4%
*-commutative90.4%
associate-*l/90.5%
Applied egg-rr90.5%
associate-/l*90.4%
div-inv90.4%
clear-num90.4%
Applied egg-rr90.4%
clear-num90.4%
un-div-inv90.4%
div-inv90.5%
metadata-eval90.5%
Applied egg-rr90.5%
if -6.9e-6 < y < 1.10000000000000003e-58Initial program 93.7%
associate-+l-93.7%
sub-neg93.7%
sub-neg93.7%
distribute-neg-in93.7%
unsub-neg93.7%
neg-mul-193.7%
associate-*r/93.7%
associate-*l/93.7%
distribute-neg-frac93.7%
neg-mul-193.7%
times-frac95.0%
distribute-lft-out--95.0%
*-commutative95.0%
associate-/r*95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in y around 0 88.6%
*-commutative88.6%
associate-*l/88.6%
times-frac89.9%
Simplified89.9%
Final simplification90.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8.5e-6) (not (<= y 6.5e-59))) (- x (/ y (* z 3.0))) (+ x (/ (/ t y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.5e-6) || !(y <= 6.5e-59)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x + ((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 ((y <= (-8.5d-6)) .or. (.not. (y <= 6.5d-59))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = x + ((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 ((y <= -8.5e-6) || !(y <= 6.5e-59)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x + ((t / y) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8.5e-6) or not (y <= 6.5e-59): tmp = x - (y / (z * 3.0)) else: tmp = x + ((t / y) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8.5e-6) || !(y <= 6.5e-59)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(x + Float64(Float64(t / y) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -8.5e-6) || ~((y <= 6.5e-59))) tmp = x - (y / (z * 3.0)); else tmp = x + ((t / y) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8.5e-6], N[Not[LessEqual[y, 6.5e-59]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-6} \lor \neg \left(y \leq 6.5 \cdot 10^{-59}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y}}{z \cdot 3}\\
\end{array}
\end{array}
if y < -8.4999999999999999e-6 or 6.50000000000000017e-59 < y Initial program 97.7%
Taylor expanded in t around 0 90.4%
*-commutative90.4%
associate-*l/90.5%
Applied egg-rr90.5%
associate-/l*90.4%
div-inv90.4%
clear-num90.4%
Applied egg-rr90.4%
clear-num90.4%
un-div-inv90.4%
div-inv90.5%
metadata-eval90.5%
Applied egg-rr90.5%
if -8.4999999999999999e-6 < y < 6.50000000000000017e-59Initial program 93.7%
associate-+l-93.7%
sub-neg93.7%
sub-neg93.7%
distribute-neg-in93.7%
unsub-neg93.7%
neg-mul-193.7%
associate-*r/93.7%
associate-*l/93.7%
distribute-neg-frac93.7%
neg-mul-193.7%
times-frac95.0%
distribute-lft-out--95.0%
*-commutative95.0%
associate-/r*95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in y around 0 88.6%
*-commutative88.6%
associate-*l/88.6%
times-frac89.9%
Simplified89.9%
clear-num90.0%
un-div-inv90.0%
div-inv90.0%
metadata-eval90.0%
Applied egg-rr90.0%
Final simplification90.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.5e-6) (not (<= y 6.6e-43))) (- 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 <= -7.5e-6) || !(y <= 6.6e-43)) {
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 <= (-7.5d-6)) .or. (.not. (y <= 6.6d-43))) 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 <= -7.5e-6) || !(y <= 6.6e-43)) {
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 <= -7.5e-6) or not (y <= 6.6e-43): 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 <= -7.5e-6) || !(y <= 6.6e-43)) 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 <= -7.5e-6) || ~((y <= 6.6e-43))) 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, -7.5e-6], N[Not[LessEqual[y, 6.6e-43]], $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 -7.5 \cdot 10^{-6} \lor \neg \left(y \leq 6.6 \cdot 10^{-43}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{z} \cdot \frac{-0.3333333333333333}{y}\\
\end{array}
\end{array}
if y < -7.50000000000000019e-6 or 6.60000000000000031e-43 < y Initial program 97.7%
Taylor expanded in t around 0 91.1%
*-commutative91.1%
associate-*l/91.2%
Applied egg-rr91.2%
associate-/l*91.1%
div-inv91.0%
clear-num91.1%
Applied egg-rr91.1%
clear-num91.0%
un-div-inv91.1%
div-inv91.2%
metadata-eval91.2%
Applied egg-rr91.2%
if -7.50000000000000019e-6 < y < 6.60000000000000031e-43Initial program 93.8%
associate-+l-93.8%
associate-/r*99.8%
associate-/r*99.8%
div-inv99.8%
metadata-eval99.8%
associate-/r*93.8%
associate-*l*93.8%
Applied egg-rr93.8%
Taylor expanded in y around 0 88.1%
associate-*r/88.1%
metadata-eval88.1%
distribute-lft-neg-in88.1%
*-commutative88.1%
distribute-rgt-neg-in88.1%
metadata-eval88.1%
Simplified88.1%
*-commutative88.1%
times-frac94.0%
Applied egg-rr94.0%
Final simplification92.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.4e-6) (not (<= y 5.4e-43))) (- x (/ y (* z 3.0))) (- x (/ (/ t z) (* y -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.4e-6) || !(y <= 5.4e-43)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x - ((t / z) / (y * -3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-7.4d-6)) .or. (.not. (y <= 5.4d-43))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = x - ((t / z) / (y * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.4e-6) || !(y <= 5.4e-43)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x - ((t / z) / (y * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.4e-6) or not (y <= 5.4e-43): tmp = x - (y / (z * 3.0)) else: tmp = x - ((t / z) / (y * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.4e-6) || !(y <= 5.4e-43)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(x - Float64(Float64(t / z) / Float64(y * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.4e-6) || ~((y <= 5.4e-43))) tmp = x - (y / (z * 3.0)); else tmp = x - ((t / z) / (y * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.4e-6], N[Not[LessEqual[y, 5.4e-43]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(t / z), $MachinePrecision] / N[(y * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{-6} \lor \neg \left(y \leq 5.4 \cdot 10^{-43}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\frac{t}{z}}{y \cdot -3}\\
\end{array}
\end{array}
if y < -7.4000000000000003e-6 or 5.39999999999999982e-43 < y Initial program 97.7%
Taylor expanded in t around 0 91.1%
*-commutative91.1%
associate-*l/91.2%
Applied egg-rr91.2%
associate-/l*91.1%
div-inv91.0%
clear-num91.1%
Applied egg-rr91.1%
clear-num91.0%
un-div-inv91.1%
div-inv91.2%
metadata-eval91.2%
Applied egg-rr91.2%
if -7.4000000000000003e-6 < y < 5.39999999999999982e-43Initial program 93.8%
associate-+l-93.8%
associate-/r*99.8%
associate-/r*99.8%
div-inv99.8%
metadata-eval99.8%
associate-/r*93.8%
associate-*l*93.8%
Applied egg-rr93.8%
Taylor expanded in y around 0 88.1%
associate-*r/88.1%
metadata-eval88.1%
distribute-lft-neg-in88.1%
*-commutative88.1%
distribute-rgt-neg-in88.1%
metadata-eval88.1%
Simplified88.1%
*-commutative88.1%
times-frac94.0%
Applied egg-rr94.0%
clear-num94.0%
un-div-inv94.0%
div-inv94.1%
metadata-eval94.1%
Applied egg-rr94.1%
Final simplification92.5%
(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 95.9%
associate-+l-95.9%
sub-neg95.9%
sub-neg95.9%
distribute-neg-in95.9%
unsub-neg95.9%
neg-mul-195.9%
associate-*r/95.9%
associate-*l/95.8%
distribute-neg-frac95.8%
neg-mul-195.8%
times-frac96.5%
distribute-lft-out--97.2%
*-commutative97.2%
associate-/r*97.2%
metadata-eval97.2%
Simplified97.2%
Final simplification97.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.9%
associate-+l-95.9%
sub-neg95.9%
sub-neg95.9%
distribute-neg-in95.9%
unsub-neg95.9%
neg-mul-195.9%
associate-*r/95.9%
associate-*l/95.8%
distribute-neg-frac95.8%
neg-mul-195.8%
times-frac96.5%
distribute-lft-out--97.2%
*-commutative97.2%
associate-/r*97.2%
metadata-eval97.2%
Simplified97.2%
*-commutative97.2%
clear-num97.2%
un-div-inv97.2%
div-inv97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Taylor expanded in y around inf 69.9%
metadata-eval69.9%
distribute-lft-neg-in69.9%
associate-*r/70.0%
associate-/l*69.9%
distribute-neg-frac69.9%
metadata-eval69.9%
Simplified69.9%
Final simplification69.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 95.9%
Taylor expanded in t around 0 69.9%
*-commutative69.9%
associate-*l/70.0%
Applied egg-rr70.0%
associate-/l*69.9%
div-inv69.9%
clear-num69.9%
Applied egg-rr69.9%
Final simplification69.9%
(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 95.9%
Taylor expanded in t around 0 69.9%
*-commutative69.9%
associate-*l/70.0%
Applied egg-rr70.0%
associate-/l*69.9%
div-inv69.9%
clear-num69.9%
Applied egg-rr69.9%
clear-num69.9%
un-div-inv69.9%
div-inv70.0%
metadata-eval70.0%
Applied egg-rr70.0%
Final simplification70.0%
(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.9%
Taylor expanded in x around inf 34.7%
Final simplification34.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 2023185
(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))))