
(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 8 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) 4e-106) (+ x (/ (- y (/ t y)) (* z -3.0))) (+ (- 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) <= 4e-106) {
tmp = x + ((y - (t / y)) / (z * -3.0));
} 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) <= 4d-106) then
tmp = x + ((y - (t / y)) / (z * (-3.0d0)))
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) <= 4e-106) {
tmp = x + ((y - (t / y)) / (z * -3.0));
} 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) <= 4e-106: tmp = x + ((y - (t / y)) / (z * -3.0)) 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) <= 4e-106) tmp = Float64(x + Float64(Float64(y - Float64(t / y)) / Float64(z * -3.0))); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= 4e-106) tmp = x + ((y - (t / y)) / (z * -3.0)); 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], 4e-106], N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 4 \cdot 10^{-106}:\\
\;\;\;\;x + \frac{y - \frac{t}{y}}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\end{array}
\end{array}
if (*.f64 z 3) < 3.99999999999999976e-106Initial program 94.0%
associate-+l-94.0%
sub-neg94.0%
sub-neg94.0%
distribute-neg-in94.0%
unsub-neg94.0%
neg-mul-194.0%
associate-*r/94.0%
associate-*l/94.0%
distribute-neg-frac94.0%
neg-mul-194.0%
times-frac96.8%
distribute-lft-out--98.7%
*-commutative98.7%
associate-/r*98.6%
metadata-eval98.6%
Simplified98.6%
*-commutative98.6%
clear-num98.5%
un-div-inv98.6%
div-inv98.7%
metadata-eval98.7%
Applied egg-rr98.7%
if 3.99999999999999976e-106 < (*.f64 z 3) Initial program 99.8%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.7e-84) (not (<= y 1e+38))) (+ 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 <= -2.7e-84) || !(y <= 1e+38)) {
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 <= (-2.7d-84)) .or. (.not. (y <= 1d+38))) 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 <= -2.7e-84) || !(y <= 1e+38)) {
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 <= -2.7e-84) or not (y <= 1e+38): 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 <= -2.7e-84) || !(y <= 1e+38)) tmp = Float64(x + Float64(Float64(y / 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 <= -2.7e-84) || ~((y <= 1e+38))) 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, -2.7e-84], N[Not[LessEqual[y, 1e+38]], $MachinePrecision]], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $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 -2.7 \cdot 10^{-84} \lor \neg \left(y \leq 10^{+38}\right):\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -2.6999999999999999e-84 or 9.99999999999999977e37 < y Initial program 97.7%
associate-+l-97.7%
sub-neg97.7%
sub-neg97.7%
distribute-neg-in97.7%
unsub-neg97.7%
neg-mul-197.7%
associate-*r/97.7%
associate-*l/97.6%
distribute-neg-frac97.6%
neg-mul-197.6%
times-frac97.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
div-inv99.8%
metadata-eval99.8%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 94.7%
if -2.6999999999999999e-84 < y < 9.99999999999999977e37Initial 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/94.0%
distribute-neg-frac94.0%
neg-mul-194.0%
times-frac93.8%
distribute-lft-out--93.8%
*-commutative93.8%
associate-/r*93.7%
metadata-eval93.7%
Simplified93.7%
Taylor expanded in y around 0 91.1%
*-commutative91.1%
associate-*l/91.1%
times-frac90.9%
Simplified90.9%
Final simplification93.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.7e-84) (not (<= y 1.3e+38))) (+ 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 <= -2.7e-84) || !(y <= 1.3e+38)) {
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 <= (-2.7d-84)) .or. (.not. (y <= 1.3d+38))) 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 <= -2.7e-84) || !(y <= 1.3e+38)) {
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 <= -2.7e-84) or not (y <= 1.3e+38): 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 <= -2.7e-84) || !(y <= 1.3e+38)) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); else tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(z * y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.7e-84) || ~((y <= 1.3e+38))) 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, -2.7e-84], N[Not[LessEqual[y, 1.3e+38]], $MachinePrecision]], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-84} \lor \neg \left(y \leq 1.3 \cdot 10^{+38}\right):\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{else}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\end{array}
\end{array}
if y < -2.6999999999999999e-84 or 1.3e38 < y Initial program 97.7%
associate-+l-97.7%
sub-neg97.7%
sub-neg97.7%
distribute-neg-in97.7%
unsub-neg97.7%
neg-mul-197.7%
associate-*r/97.7%
associate-*l/97.6%
distribute-neg-frac97.6%
neg-mul-197.6%
times-frac97.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
div-inv99.8%
metadata-eval99.8%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 94.7%
if -2.6999999999999999e-84 < y < 1.3e38Initial program 93.9%
Taylor expanded in y around 0 91.1%
Final simplification93.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5e-26) (not (<= y 1.2e+38))) (+ x (/ (/ y z) -3.0)) (+ x (/ (/ (* t 0.3333333333333333) z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5e-26) || !(y <= 1.2e+38)) {
tmp = x + ((y / z) / -3.0);
} else {
tmp = x + (((t * 0.3333333333333333) / z) / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-5d-26)) .or. (.not. (y <= 1.2d+38))) then
tmp = x + ((y / z) / (-3.0d0))
else
tmp = x + (((t * 0.3333333333333333d0) / z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5e-26) || !(y <= 1.2e+38)) {
tmp = x + ((y / z) / -3.0);
} else {
tmp = x + (((t * 0.3333333333333333) / z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5e-26) or not (y <= 1.2e+38): tmp = x + ((y / z) / -3.0) else: tmp = x + (((t * 0.3333333333333333) / z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5e-26) || !(y <= 1.2e+38)) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); else tmp = Float64(x + Float64(Float64(Float64(t * 0.3333333333333333) / z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5e-26) || ~((y <= 1.2e+38))) tmp = x + ((y / z) / -3.0); else tmp = x + (((t * 0.3333333333333333) / z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5e-26], N[Not[LessEqual[y, 1.2e+38]], $MachinePrecision]], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-26} \lor \neg \left(y \leq 1.2 \cdot 10^{+38}\right):\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t \cdot 0.3333333333333333}{z}}{y}\\
\end{array}
\end{array}
if y < -5.00000000000000019e-26 or 1.20000000000000009e38 < y Initial program 97.6%
associate-+l-97.6%
sub-neg97.6%
sub-neg97.6%
distribute-neg-in97.6%
unsub-neg97.6%
neg-mul-197.6%
associate-*r/97.6%
associate-*l/97.5%
distribute-neg-frac97.5%
neg-mul-197.5%
times-frac97.6%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
div-inv99.7%
Applied egg-rr99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
div-inv99.8%
metadata-eval99.8%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 95.2%
if -5.00000000000000019e-26 < y < 1.20000000000000009e38Initial program 94.2%
Taylor expanded in y around 0 90.7%
associate-*r/90.6%
*-commutative90.6%
associate-/r*94.6%
*-commutative94.6%
Applied egg-rr94.6%
Final simplification94.9%
(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.1%
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 (/ (- 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 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.1%
distribute-lft-out--97.2%
*-commutative97.2%
associate-/r*97.2%
metadata-eval97.2%
Simplified97.2%
*-commutative97.2%
clear-num97.1%
un-div-inv97.2%
div-inv97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Final simplification97.3%
(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(Float64(y / 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[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{y}{z}}{-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.1%
distribute-lft-out--97.2%
*-commutative97.2%
associate-/r*97.2%
metadata-eval97.2%
Simplified97.2%
div-inv97.2%
Applied egg-rr97.2%
*-commutative97.2%
*-commutative97.2%
associate-*r*97.2%
div-inv97.3%
metadata-eval97.3%
div-inv97.3%
Applied egg-rr97.3%
Taylor expanded in y around inf 71.4%
Final simplification71.4%
(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 96.1%
Taylor expanded in x around inf 36.2%
Final simplification36.2%
(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 2023238
(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))))