
(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 (+ (+ (/ t (* z (* y 3.0))) x) (/ (/ y z) -3.0)))
double code(double x, double y, double z, double t) {
return ((t / (z * (y * 3.0))) + 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 = ((t / (z * (y * 3.0d0))) + x) + ((y / z) / (-3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return ((t / (z * (y * 3.0))) + x) + ((y / z) / -3.0);
}
def code(x, y, z, t): return ((t / (z * (y * 3.0))) + x) + ((y / z) / -3.0)
function code(x, y, z, t) return Float64(Float64(Float64(t / Float64(z * Float64(y * 3.0))) + x) + Float64(Float64(y / z) / -3.0)) end
function tmp = code(x, y, z, t) tmp = ((t / (z * (y * 3.0))) + x) + ((y / z) / -3.0); end
code[x_, y_, z_, t_] := N[(N[(N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{\frac{y}{z}}{-3}
\end{array}
Initial program 97.5%
+-commutative97.5%
associate-+r-97.5%
sub-neg97.5%
associate-*l*97.6%
*-commutative97.6%
distribute-frac-neg297.6%
distribute-rgt-neg-in97.6%
metadata-eval97.6%
Simplified97.6%
associate-/r*97.6%
add-cube-cbrt97.2%
associate-/l*97.2%
pow297.2%
Applied egg-rr97.2%
associate-*r/97.2%
unpow297.2%
rem-3cbrt-lft97.6%
Simplified97.6%
Final simplification97.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6e-8) (not (<= y 7e-59))) (+ 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 <= -6e-8) || !(y <= 7e-59)) {
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 <= (-6d-8)) .or. (.not. (y <= 7d-59))) 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 <= -6e-8) || !(y <= 7e-59)) {
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 <= -6e-8) or not (y <= 7e-59): 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 <= -6e-8) || !(y <= 7e-59)) 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 <= -6e-8) || ~((y <= 7e-59))) 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, -6e-8], N[Not[LessEqual[y, 7e-59]], $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 -6 \cdot 10^{-8} \lor \neg \left(y \leq 7 \cdot 10^{-59}\right):\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{else}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\end{array}
\end{array}
if y < -5.99999999999999946e-8 or 7.0000000000000002e-59 < y Initial program 99.9%
sub-neg99.9%
associate-+l+99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.8%
*-commutative99.8%
neg-mul-199.8%
times-frac99.8%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 94.5%
*-commutative94.5%
metadata-eval94.5%
div-inv94.6%
Applied egg-rr94.6%
if -5.99999999999999946e-8 < y < 7.0000000000000002e-59Initial program 94.9%
sub-neg94.9%
associate-+l+94.9%
remove-double-neg94.9%
distribute-frac-neg94.9%
sub-neg94.9%
distribute-frac-neg94.9%
neg-mul-194.9%
*-commutative94.9%
associate-/l*94.9%
*-commutative94.9%
neg-mul-194.9%
times-frac92.2%
distribute-lft-out--92.2%
*-commutative92.2%
associate-/r*92.2%
metadata-eval92.2%
Simplified92.2%
Taylor expanded in y around 0 94.2%
Final simplification94.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -0.000145) (not (<= y 7e-59))) (+ x (/ (/ y z) -3.0)) (+ x (/ 0.3333333333333333 (* y (/ z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.000145) || !(y <= 7e-59)) {
tmp = x + ((y / z) / -3.0);
} else {
tmp = x + (0.3333333333333333 / (y * (z / t)));
}
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 <= (-0.000145d0)) .or. (.not. (y <= 7d-59))) then
tmp = x + ((y / z) / (-3.0d0))
else
tmp = x + (0.3333333333333333d0 / (y * (z / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.000145) || !(y <= 7e-59)) {
tmp = x + ((y / z) / -3.0);
} else {
tmp = x + (0.3333333333333333 / (y * (z / t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -0.000145) or not (y <= 7e-59): tmp = x + ((y / z) / -3.0) else: tmp = x + (0.3333333333333333 / (y * (z / t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -0.000145) || !(y <= 7e-59)) tmp = Float64(x + Float64(Float64(y / z) / -3.0)); else tmp = Float64(x + Float64(0.3333333333333333 / Float64(y * Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -0.000145) || ~((y <= 7e-59))) tmp = x + ((y / z) / -3.0); else tmp = x + (0.3333333333333333 / (y * (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -0.000145], N[Not[LessEqual[y, 7e-59]], $MachinePrecision]], N[(x + N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(0.3333333333333333 / N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.000145 \lor \neg \left(y \leq 7 \cdot 10^{-59}\right):\\
\;\;\;\;x + \frac{\frac{y}{z}}{-3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\
\end{array}
\end{array}
if y < -1.45e-4 or 7.0000000000000002e-59 < y Initial program 99.9%
sub-neg99.9%
associate-+l+99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
sub-neg99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.8%
*-commutative99.8%
neg-mul-199.8%
times-frac99.8%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 94.5%
*-commutative94.5%
metadata-eval94.5%
div-inv94.6%
Applied egg-rr94.6%
if -1.45e-4 < y < 7.0000000000000002e-59Initial program 94.9%
sub-neg94.9%
associate-+l+94.9%
remove-double-neg94.9%
distribute-frac-neg94.9%
sub-neg94.9%
distribute-frac-neg94.9%
neg-mul-194.9%
*-commutative94.9%
associate-/l*94.9%
*-commutative94.9%
neg-mul-194.9%
times-frac92.2%
distribute-lft-out--92.2%
*-commutative92.2%
associate-/r*92.2%
metadata-eval92.2%
Simplified92.2%
Taylor expanded in y around 0 94.2%
clear-num94.1%
un-div-inv94.8%
associate-/l*95.3%
Applied egg-rr95.3%
Final simplification94.9%
(FPCore (x y z t) :precision binary64 (if (<= x -4.2e+49) x (if (<= x 8e+34) (* (/ y z) -0.3333333333333333) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.2e+49) {
tmp = x;
} else if (x <= 8e+34) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
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 (x <= (-4.2d+49)) then
tmp = x
else if (x <= 8d+34) then
tmp = (y / z) * (-0.3333333333333333d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.2e+49) {
tmp = x;
} else if (x <= 8e+34) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.2e+49: tmp = x elif x <= 8e+34: tmp = (y / z) * -0.3333333333333333 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.2e+49) tmp = x; elseif (x <= 8e+34) tmp = Float64(Float64(y / z) * -0.3333333333333333); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.2e+49) tmp = x; elseif (x <= 8e+34) tmp = (y / z) * -0.3333333333333333; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.2e+49], x, If[LessEqual[x, 8e+34], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+49}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+34}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.20000000000000022e49 or 7.99999999999999956e34 < x Initial program 97.2%
sub-neg97.2%
associate-+l+97.2%
remove-double-neg97.2%
distribute-frac-neg97.2%
sub-neg97.2%
distribute-frac-neg97.2%
neg-mul-197.2%
*-commutative97.2%
associate-/l*97.2%
*-commutative97.2%
neg-mul-197.2%
times-frac96.0%
distribute-lft-out--96.0%
*-commutative96.0%
associate-/r*95.9%
metadata-eval95.9%
Simplified95.9%
Taylor expanded in y around inf 73.5%
Taylor expanded in x around inf 56.6%
if -4.20000000000000022e49 < x < 7.99999999999999956e34Initial program 97.8%
sub-neg97.8%
associate-+l+97.8%
remove-double-neg97.8%
distribute-frac-neg97.8%
sub-neg97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.7%
*-commutative97.7%
neg-mul-197.7%
times-frac96.5%
distribute-lft-out--96.5%
*-commutative96.5%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in y around inf 58.0%
*-commutative58.0%
metadata-eval58.0%
div-inv58.0%
Applied egg-rr58.0%
Taylor expanded in x around 0 49.1%
Final simplification52.5%
(FPCore (x y z t) :precision binary64 (if (<= x -1.4e+50) x (if (<= x 6.8e+34) (/ (/ y z) -3.0) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.4e+50) {
tmp = x;
} else if (x <= 6.8e+34) {
tmp = (y / z) / -3.0;
} else {
tmp = x;
}
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 (x <= (-1.4d+50)) then
tmp = x
else if (x <= 6.8d+34) then
tmp = (y / z) / (-3.0d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.4e+50) {
tmp = x;
} else if (x <= 6.8e+34) {
tmp = (y / z) / -3.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.4e+50: tmp = x elif x <= 6.8e+34: tmp = (y / z) / -3.0 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.4e+50) tmp = x; elseif (x <= 6.8e+34) tmp = Float64(Float64(y / z) / -3.0); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.4e+50) tmp = x; elseif (x <= 6.8e+34) tmp = (y / z) / -3.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.4e+50], x, If[LessEqual[x, 6.8e+34], N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+34}:\\
\;\;\;\;\frac{\frac{y}{z}}{-3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.3999999999999999e50 or 6.7999999999999999e34 < x Initial program 97.2%
sub-neg97.2%
associate-+l+97.2%
remove-double-neg97.2%
distribute-frac-neg97.2%
sub-neg97.2%
distribute-frac-neg97.2%
neg-mul-197.2%
*-commutative97.2%
associate-/l*97.2%
*-commutative97.2%
neg-mul-197.2%
times-frac96.0%
distribute-lft-out--96.0%
*-commutative96.0%
associate-/r*95.9%
metadata-eval95.9%
Simplified95.9%
Taylor expanded in y around inf 73.5%
Taylor expanded in x around inf 56.6%
if -1.3999999999999999e50 < x < 6.7999999999999999e34Initial program 97.8%
sub-neg97.8%
associate-+l+97.8%
remove-double-neg97.8%
distribute-frac-neg97.8%
sub-neg97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.7%
*-commutative97.7%
neg-mul-197.7%
times-frac96.5%
distribute-lft-out--96.5%
*-commutative96.5%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in y around inf 58.0%
*-commutative58.0%
metadata-eval58.0%
div-inv58.0%
Applied egg-rr58.0%
Taylor expanded in x around 0 49.1%
*-commutative49.1%
associate-*l/49.0%
associate-/l*49.0%
Simplified49.0%
metadata-eval49.0%
associate-/r*49.1%
*-commutative49.1%
div-inv49.1%
associate-/r*49.2%
Applied egg-rr49.2%
Final simplification52.5%
(FPCore (x y z t) :precision binary64 (+ (+ (/ t (* z (* y 3.0))) x) (/ y (* z -3.0))))
double code(double x, double y, double z, double t) {
return ((t / (z * (y * 3.0))) + 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 = ((t / (z * (y * 3.0d0))) + x) + (y / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0));
}
def code(x, y, z, t): return ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0))
function code(x, y, z, t) return Float64(Float64(Float64(t / Float64(z * Float64(y * 3.0))) + x) + Float64(y / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = ((t / (z * (y * 3.0))) + x) + (y / (z * -3.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot -3}
\end{array}
Initial program 97.5%
+-commutative97.5%
associate-+r-97.5%
sub-neg97.5%
associate-*l*97.6%
*-commutative97.6%
distribute-frac-neg297.6%
distribute-rgt-neg-in97.6%
metadata-eval97.6%
Simplified97.6%
Final simplification97.6%
(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 97.5%
sub-neg97.5%
associate-+l+97.5%
remove-double-neg97.5%
distribute-frac-neg97.5%
sub-neg97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.5%
*-commutative97.5%
neg-mul-197.5%
times-frac96.2%
distribute-lft-out--96.2%
*-commutative96.2%
associate-/r*96.2%
metadata-eval96.2%
Simplified96.2%
Taylor expanded in z around 0 96.3%
Final simplification96.3%
(FPCore (x y z t) :precision binary64 (+ x (* (/ y z) -0.3333333333333333)))
double code(double x, double y, double z, double t) {
return x + ((y / z) * -0.3333333333333333);
}
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) * (-0.3333333333333333d0))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y / z) * -0.3333333333333333);
}
def code(x, y, z, t): return x + ((y / z) * -0.3333333333333333)
function code(x, y, z, t) return Float64(x + Float64(Float64(y / z) * -0.3333333333333333)) end
function tmp = code(x, y, z, t) tmp = x + ((y / z) * -0.3333333333333333); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{z} \cdot -0.3333333333333333
\end{array}
Initial program 97.5%
sub-neg97.5%
associate-+l+97.5%
remove-double-neg97.5%
distribute-frac-neg97.5%
sub-neg97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.5%
*-commutative97.5%
neg-mul-197.5%
times-frac96.2%
distribute-lft-out--96.2%
*-commutative96.2%
associate-/r*96.2%
metadata-eval96.2%
Simplified96.2%
Taylor expanded in y around inf 65.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(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 97.5%
sub-neg97.5%
associate-+l+97.5%
remove-double-neg97.5%
distribute-frac-neg97.5%
sub-neg97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.5%
*-commutative97.5%
neg-mul-197.5%
times-frac96.2%
distribute-lft-out--96.2%
*-commutative96.2%
associate-/r*96.2%
metadata-eval96.2%
Simplified96.2%
Taylor expanded in y around inf 65.0%
*-commutative65.0%
metadata-eval65.0%
div-inv65.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 97.5%
sub-neg97.5%
associate-+l+97.5%
remove-double-neg97.5%
distribute-frac-neg97.5%
sub-neg97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.5%
*-commutative97.5%
neg-mul-197.5%
times-frac96.2%
distribute-lft-out--96.2%
*-commutative96.2%
associate-/r*96.2%
metadata-eval96.2%
Simplified96.2%
Taylor expanded in y around inf 65.0%
Taylor expanded in x around inf 31.6%
Final simplification31.6%
(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 2024076
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))