
(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 13 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) 2e-195) (+ x (* (* -0.3333333333333333 (/ 1.0 z)) (- y (/ t y)))) (+ (- x (/ y (* z 3.0))) (/ t (* z (* 3.0 y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 2e-195) {
tmp = x + ((-0.3333333333333333 * (1.0 / z)) * (y - (t / y)));
} else {
tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * 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 ((z * 3.0d0) <= 2d-195) then
tmp = x + (((-0.3333333333333333d0) * (1.0d0 / z)) * (y - (t / y)))
else
tmp = (x - (y / (z * 3.0d0))) + (t / (z * (3.0d0 * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= 2e-195) {
tmp = x + ((-0.3333333333333333 * (1.0 / z)) * (y - (t / y)));
} else {
tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= 2e-195: tmp = x + ((-0.3333333333333333 * (1.0 / z)) * (y - (t / y))) else: tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= 2e-195) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * Float64(1.0 / z)) * Float64(y - Float64(t / y)))); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(z * Float64(3.0 * y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= 2e-195) tmp = x + ((-0.3333333333333333 * (1.0 / z)) * (y - (t / y))); else tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 2e-195], N[(x + N[(N[(-0.3333333333333333 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z * N[(3.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 2 \cdot 10^{-195}:\\
\;\;\;\;x + \left(-0.3333333333333333 \cdot \frac{1}{z}\right) \cdot \left(y - \frac{t}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(3 \cdot y\right)}\\
\end{array}
\end{array}
if (*.f64 z 3) < 2.0000000000000002e-195Initial program 91.8%
Simplified98.6%
div-inv98.6%
Applied egg-rr98.6%
if 2.0000000000000002e-195 < (*.f64 z 3) Initial program 99.8%
Taylor expanded in z around 0 99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.2e+22)
(+ x (/ (/ y -3.0) z))
(if (<= y 7.2e-28)
(+ x (/ (/ (* -0.3333333333333333 t) z) (- y)))
(+ x (/ (/ y z) -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e+22) {
tmp = x + ((y / -3.0) / z);
} else if (y <= 7.2e-28) {
tmp = x + (((-0.3333333333333333 * t) / z) / -y);
} else {
tmp = x + ((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 <= (-6.2d+22)) then
tmp = x + ((y / (-3.0d0)) / z)
else if (y <= 7.2d-28) then
tmp = x + ((((-0.3333333333333333d0) * t) / z) / -y)
else
tmp = x + ((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 <= -6.2e+22) {
tmp = x + ((y / -3.0) / z);
} else if (y <= 7.2e-28) {
tmp = x + (((-0.3333333333333333 * t) / z) / -y);
} else {
tmp = x + ((y / z) / -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.2e+22: tmp = x + ((y / -3.0) / z) elif y <= 7.2e-28: tmp = x + (((-0.3333333333333333 * t) / z) / -y) else: tmp = x + ((y / z) / -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.2e+22) tmp = Float64(x + Float64(Float64(y / -3.0) / z)); elseif (y <= 7.2e-28) tmp = Float64(x + Float64(Float64(Float64(-0.3333333333333333 * t) / z) / Float64(-y))); else tmp = Float64(x + Float64(Float64(y / z) / -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.2e+22) tmp = x + ((y / -3.0) / z); elseif (y <= 7.2e-28) tmp = x + (((-0.3333333333333333 * t) / z) / -y); else tmp = x + ((y / z) / -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.2e+22], N[(x + N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e-28], N[(x + N[(N[(N[(-0.3333333333333333 * t), $MachinePrecision] / z), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{\frac{y}{-3}}{z}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-28}:\\
\;\;\;\;x + \frac{\frac{-0.3333333333333333 \cdot t}{z}}{-y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\end{array}
\end{array}
if y < -6.2000000000000004e22Initial program 98.1%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 90.0%
associate-*l*90.0%
associate-*l/90.0%
*-un-lft-identity90.0%
metadata-eval90.0%
times-frac90.2%
*-un-lft-identity90.2%
associate-/r*90.2%
Applied egg-rr90.2%
if -6.2000000000000004e22 < y < 7.1999999999999997e-28Initial program 90.1%
Simplified94.3%
Taylor expanded in y around 0 87.0%
associate-*r/87.0%
frac-2neg87.0%
*-commutative87.0%
distribute-rgt-neg-in87.0%
Applied egg-rr87.0%
associate-/r*93.9%
distribute-lft-neg-in93.9%
metadata-eval93.9%
Simplified93.9%
if 7.1999999999999997e-28 < y Initial program 99.8%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 88.4%
*-commutative88.4%
*-commutative88.4%
associate-*r*88.3%
div-inv88.4%
metadata-eval88.4%
div-inv88.5%
Applied egg-rr88.5%
Final simplification91.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -7.5e+21)
(+ x (/ (/ y -3.0) z))
(if (<= y 9.6e-29)
(+ x (* 0.3333333333333333 (/ t (* z y))))
(+ x (/ (/ y z) -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+21) {
tmp = x + ((y / -3.0) / z);
} else if (y <= 9.6e-29) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x + ((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 <= (-7.5d+21)) then
tmp = x + ((y / (-3.0d0)) / z)
else if (y <= 9.6d-29) then
tmp = x + (0.3333333333333333d0 * (t / (z * y)))
else
tmp = x + ((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 <= -7.5e+21) {
tmp = x + ((y / -3.0) / z);
} else if (y <= 9.6e-29) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = x + ((y / z) / -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.5e+21: tmp = x + ((y / -3.0) / z) elif y <= 9.6e-29: tmp = x + (0.3333333333333333 * (t / (z * y))) else: tmp = x + ((y / z) / -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e+21) tmp = Float64(x + Float64(Float64(y / -3.0) / z)); elseif (y <= 9.6e-29) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(z * y)))); else tmp = Float64(x + Float64(Float64(y / z) / -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.5e+21) tmp = x + ((y / -3.0) / z); elseif (y <= 9.6e-29) tmp = x + (0.3333333333333333 * (t / (z * y))); else tmp = x + ((y / z) / -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e+21], N[(x + N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.6e-29], N[(x + N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+21}:\\
\;\;\;\;x + \frac{\frac{y}{-3}}{z}\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-29}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\end{array}
\end{array}
if y < -7.5e21Initial program 98.1%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 90.0%
associate-*l*90.0%
associate-*l/90.0%
*-un-lft-identity90.0%
metadata-eval90.0%
times-frac90.2%
*-un-lft-identity90.2%
associate-/r*90.2%
Applied egg-rr90.2%
if -7.5e21 < y < 9.59999999999999968e-29Initial program 90.1%
Simplified94.3%
Taylor expanded in y around 0 87.0%
if 9.59999999999999968e-29 < y Initial program 99.8%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 88.4%
*-commutative88.4%
*-commutative88.4%
associate-*r*88.3%
div-inv88.4%
metadata-eval88.4%
div-inv88.5%
Applied egg-rr88.5%
Final simplification88.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.2e+22)
(+ x (/ (/ y -3.0) z))
(if (<= y 9e-28)
(+ x (* (/ t y) (/ 0.3333333333333333 z)))
(+ x (/ (/ y z) -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e+22) {
tmp = x + ((y / -3.0) / z);
} else if (y <= 9e-28) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + ((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 <= (-6.2d+22)) then
tmp = x + ((y / (-3.0d0)) / z)
else if (y <= 9d-28) then
tmp = x + ((t / y) * (0.3333333333333333d0 / z))
else
tmp = x + ((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 <= -6.2e+22) {
tmp = x + ((y / -3.0) / z);
} else if (y <= 9e-28) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + ((y / z) / -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.2e+22: tmp = x + ((y / -3.0) / z) elif y <= 9e-28: tmp = x + ((t / y) * (0.3333333333333333 / z)) else: tmp = x + ((y / z) / -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.2e+22) tmp = Float64(x + Float64(Float64(y / -3.0) / z)); elseif (y <= 9e-28) tmp = Float64(x + Float64(Float64(t / y) * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(Float64(y / z) / -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.2e+22) tmp = x + ((y / -3.0) / z); elseif (y <= 9e-28) tmp = x + ((t / y) * (0.3333333333333333 / z)); else tmp = x + ((y / z) / -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.2e+22], N[(x + N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e-28], N[(x + N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{\frac{y}{-3}}{z}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-28}:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\end{array}
\end{array}
if y < -6.2000000000000004e22Initial program 98.1%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 90.0%
associate-*l*90.0%
associate-*l/90.0%
*-un-lft-identity90.0%
metadata-eval90.0%
times-frac90.2%
*-un-lft-identity90.2%
associate-/r*90.2%
Applied egg-rr90.2%
if -6.2000000000000004e22 < y < 8.9999999999999996e-28Initial program 90.1%
Simplified94.3%
Taylor expanded in y around 0 87.0%
associate-/r*89.5%
associate-*r/89.5%
*-commutative89.5%
associate-*r/89.5%
Simplified89.5%
if 8.9999999999999996e-28 < y Initial program 99.8%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 88.4%
*-commutative88.4%
*-commutative88.4%
associate-*r*88.3%
div-inv88.4%
metadata-eval88.4%
div-inv88.5%
Applied egg-rr88.5%
Final simplification89.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.8e+22)
(+ x (/ (/ y -3.0) z))
(if (<= y 9e-28)
(+ x (/ 0.3333333333333333 (* z (/ y t))))
(+ x (/ (/ y z) -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e+22) {
tmp = x + ((y / -3.0) / z);
} else if (y <= 9e-28) {
tmp = x + (0.3333333333333333 / (z * (y / t)));
} else {
tmp = x + ((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 <= (-2.8d+22)) then
tmp = x + ((y / (-3.0d0)) / z)
else if (y <= 9d-28) then
tmp = x + (0.3333333333333333d0 / (z * (y / t)))
else
tmp = x + ((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 <= -2.8e+22) {
tmp = x + ((y / -3.0) / z);
} else if (y <= 9e-28) {
tmp = x + (0.3333333333333333 / (z * (y / t)));
} else {
tmp = x + ((y / z) / -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.8e+22: tmp = x + ((y / -3.0) / z) elif y <= 9e-28: tmp = x + (0.3333333333333333 / (z * (y / t))) else: tmp = x + ((y / z) / -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.8e+22) tmp = Float64(x + Float64(Float64(y / -3.0) / z)); elseif (y <= 9e-28) tmp = Float64(x + Float64(0.3333333333333333 / Float64(z * Float64(y / t)))); else tmp = Float64(x + Float64(Float64(y / z) / -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.8e+22) tmp = x + ((y / -3.0) / z); elseif (y <= 9e-28) tmp = x + (0.3333333333333333 / (z * (y / t))); else tmp = x + ((y / z) / -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e+22], N[(x + N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e-28], N[(x + N[(0.3333333333333333 / N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{\frac{y}{-3}}{z}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-28}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\end{array}
\end{array}
if y < -2.8e22Initial program 98.1%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 90.0%
associate-*l*90.0%
associate-*l/90.0%
*-un-lft-identity90.0%
metadata-eval90.0%
times-frac90.2%
*-un-lft-identity90.2%
associate-/r*90.2%
Applied egg-rr90.2%
if -2.8e22 < y < 8.9999999999999996e-28Initial program 90.1%
Simplified94.3%
Taylor expanded in y around 0 87.0%
clear-num86.9%
un-div-inv87.0%
*-commutative87.0%
*-un-lft-identity87.0%
times-frac90.0%
/-rgt-identity90.0%
Applied egg-rr90.0%
if 8.9999999999999996e-28 < y Initial program 99.8%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 88.4%
*-commutative88.4%
*-commutative88.4%
associate-*r*88.3%
div-inv88.4%
metadata-eval88.4%
div-inv88.5%
Applied egg-rr88.5%
Final simplification89.6%
(FPCore (x y z t) :precision binary64 (+ x (* (* -0.3333333333333333 (/ 1.0 z)) (- y (/ t y)))))
double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * (1.0 / 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) * (1.0d0 / z)) * (y - (t / y)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * (1.0 / z)) * (y - (t / y)));
}
def code(x, y, z, t): return x + ((-0.3333333333333333 * (1.0 / z)) * (y - (t / y)))
function code(x, y, z, t) return Float64(x + Float64(Float64(-0.3333333333333333 * Float64(1.0 / z)) * Float64(y - Float64(t / y)))) end
function tmp = code(x, y, z, t) tmp = x + ((-0.3333333333333333 * (1.0 / z)) * (y - (t / y))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-0.3333333333333333 \cdot \frac{1}{z}\right) \cdot \left(y - \frac{t}{y}\right)
\end{array}
Initial program 94.9%
Simplified97.2%
div-inv97.2%
Applied egg-rr97.2%
Final simplification97.2%
(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 94.9%
Simplified97.2%
Taylor expanded in z around 0 97.2%
Final simplification97.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 94.9%
Simplified97.2%
Final simplification97.2%
(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.9%
Simplified97.2%
Taylor expanded in y around inf 64.9%
Final simplification64.9%
(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.9%
Simplified97.2%
div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in y around inf 65.0%
un-div-inv64.9%
associate-/r/65.0%
Applied egg-rr65.0%
Final simplification65.0%
(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.9%
Simplified97.2%
Taylor expanded in y around inf 64.9%
expm1-log1p-u45.2%
expm1-udef42.0%
*-commutative42.0%
clear-num42.0%
un-div-inv42.0%
div-inv42.0%
metadata-eval42.0%
Applied egg-rr42.0%
expm1-def45.2%
expm1-log1p65.0%
Simplified65.0%
Final simplification65.0%
(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 94.9%
Simplified97.2%
div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in y around inf 65.0%
associate-*l*64.9%
associate-*l/65.0%
*-un-lft-identity65.0%
metadata-eval65.0%
times-frac65.0%
*-un-lft-identity65.0%
associate-/r*65.0%
Applied egg-rr65.0%
Final simplification65.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 94.9%
Simplified97.2%
Taylor expanded in x around inf 30.7%
Final simplification30.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 2023279
(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))))