
(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 11 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 (<= t 2e-51) (+ x (/ (- (/ t y) y) (* z 3.0))) (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2e-51) {
tmp = x + (((t / y) - y) / (z * 3.0));
} else {
tmp = (x - (y / (z * 3.0))) + (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 (t <= 2d-51) then
tmp = x + (((t / y) - y) / (z * 3.0d0))
else
tmp = (x - (y / (z * 3.0d0))) + (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 (t <= 2e-51) {
tmp = x + (((t / y) - y) / (z * 3.0));
} else {
tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2e-51: tmp = x + (((t / y) - y) / (z * 3.0)) else: tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2e-51) tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2e-51) tmp = x + (((t / y) - y) / (z * 3.0)); else tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2e-51], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2 \cdot 10^{-51}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\end{array}
\end{array}
if t < 2e-51Initial program 93.8%
+-commutative93.8%
associate-+r-93.8%
+-commutative93.8%
associate--l+93.8%
sub-neg93.8%
remove-double-neg93.8%
distribute-frac-neg93.8%
distribute-neg-in93.8%
remove-double-neg93.8%
sub-neg93.8%
neg-mul-193.8%
times-frac98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
*-commutative98.7%
Simplified98.7%
*-commutative98.7%
clear-num98.7%
div-inv98.7%
metadata-eval98.7%
un-div-inv98.7%
Applied egg-rr98.7%
if 2e-51 < t Initial program 98.7%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.3e-70) (not (<= y 1e-154))) (+ x (/ (* (- (/ t y) y) 0.3333333333333333) z)) (+ x (/ (* t (/ 0.3333333333333333 z)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e-70) || !(y <= 1e-154)) {
tmp = x + ((((t / y) - y) * 0.3333333333333333) / z);
} 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 <= (-1.3d-70)) .or. (.not. (y <= 1d-154))) then
tmp = x + ((((t / y) - y) * 0.3333333333333333d0) / z)
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 <= -1.3e-70) || !(y <= 1e-154)) {
tmp = x + ((((t / y) - y) * 0.3333333333333333) / z);
} else {
tmp = x + ((t * (0.3333333333333333 / z)) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.3e-70) or not (y <= 1e-154): tmp = x + ((((t / y) - y) * 0.3333333333333333) / z) else: tmp = x + ((t * (0.3333333333333333 / z)) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.3e-70) || !(y <= 1e-154)) tmp = Float64(x + Float64(Float64(Float64(Float64(t / y) - y) * 0.3333333333333333) / z)); else tmp = Float64(x + Float64(Float64(t * Float64(0.3333333333333333 / z)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.3e-70) || ~((y <= 1e-154))) tmp = x + ((((t / y) - y) * 0.3333333333333333) / z); else tmp = x + ((t * (0.3333333333333333 / z)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.3e-70], N[Not[LessEqual[y, 1e-154]], $MachinePrecision]], N[(x + N[(N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-70} \lor \neg \left(y \leq 10^{-154}\right):\\
\;\;\;\;x + \frac{\left(\frac{t}{y} - y\right) \cdot 0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\
\end{array}
\end{array}
if y < -1.30000000000000001e-70 or 9.9999999999999997e-155 < y Initial program 97.6%
+-commutative97.6%
associate-+r-97.6%
+-commutative97.6%
associate--l+97.6%
sub-neg97.6%
remove-double-neg97.6%
distribute-frac-neg97.6%
distribute-neg-in97.6%
remove-double-neg97.6%
sub-neg97.6%
neg-mul-197.6%
times-frac98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
*-commutative98.7%
Simplified98.6%
associate-*l/98.7%
Applied egg-rr98.7%
if -1.30000000000000001e-70 < y < 9.9999999999999997e-155Initial program 90.5%
+-commutative90.5%
associate-+r-90.5%
+-commutative90.5%
associate--l+90.5%
sub-neg90.5%
remove-double-neg90.5%
distribute-frac-neg90.5%
distribute-neg-in90.5%
remove-double-neg90.5%
sub-neg90.5%
neg-mul-190.5%
times-frac87.2%
distribute-frac-neg87.2%
neg-mul-187.2%
*-commutative87.2%
associate-/l*87.2%
*-commutative87.2%
Simplified87.1%
Taylor expanded in t around inf 90.2%
associate-*r/90.1%
*-commutative90.1%
times-frac86.8%
*-commutative86.8%
associate-*l/97.0%
Simplified97.0%
Final simplification98.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.5e-72) (not (<= y 2.75e-154))) (+ x (* (- (/ t y) y) (/ 0.3333333333333333 z))) (+ x (/ (* t (/ 0.3333333333333333 z)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.5e-72) || !(y <= 2.75e-154)) {
tmp = x + (((t / y) - y) * (0.3333333333333333 / z));
} 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 <= (-3.5d-72)) .or. (.not. (y <= 2.75d-154))) then
tmp = x + (((t / y) - y) * (0.3333333333333333d0 / z))
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 <= -3.5e-72) || !(y <= 2.75e-154)) {
tmp = x + (((t / y) - y) * (0.3333333333333333 / z));
} else {
tmp = x + ((t * (0.3333333333333333 / z)) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.5e-72) or not (y <= 2.75e-154): tmp = x + (((t / y) - y) * (0.3333333333333333 / z)) else: tmp = x + ((t * (0.3333333333333333 / z)) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.5e-72) || !(y <= 2.75e-154)) tmp = Float64(x + Float64(Float64(Float64(t / y) - y) * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(Float64(t * Float64(0.3333333333333333 / z)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.5e-72) || ~((y <= 2.75e-154))) tmp = x + (((t / y) - y) * (0.3333333333333333 / z)); else tmp = x + ((t * (0.3333333333333333 / z)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.5e-72], N[Not[LessEqual[y, 2.75e-154]], $MachinePrecision]], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-72} \lor \neg \left(y \leq 2.75 \cdot 10^{-154}\right):\\
\;\;\;\;x + \left(\frac{t}{y} - y\right) \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\
\end{array}
\end{array}
if y < -3.5e-72 or 2.75000000000000001e-154 < y Initial program 97.6%
+-commutative97.6%
associate-+r-97.6%
+-commutative97.6%
associate--l+97.6%
sub-neg97.6%
remove-double-neg97.6%
distribute-frac-neg97.6%
distribute-neg-in97.6%
remove-double-neg97.6%
sub-neg97.6%
neg-mul-197.6%
times-frac98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
*-commutative98.7%
Simplified98.6%
if -3.5e-72 < y < 2.75000000000000001e-154Initial program 90.5%
+-commutative90.5%
associate-+r-90.5%
+-commutative90.5%
associate--l+90.5%
sub-neg90.5%
remove-double-neg90.5%
distribute-frac-neg90.5%
distribute-neg-in90.5%
remove-double-neg90.5%
sub-neg90.5%
neg-mul-190.5%
times-frac87.2%
distribute-frac-neg87.2%
neg-mul-187.2%
*-commutative87.2%
associate-/l*87.2%
*-commutative87.2%
Simplified87.1%
Taylor expanded in t around inf 90.2%
associate-*r/90.1%
*-commutative90.1%
times-frac86.8%
*-commutative86.8%
associate-*l/97.0%
Simplified97.0%
Final simplification98.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ t y) y)))
(if (<= y -2.5e-72)
(+ x (/ (* t_1 0.3333333333333333) z))
(if (<= y 2.1e-154)
(+ x (/ (* t (/ 0.3333333333333333 z)) y))
(+ x (/ t_1 (* z 3.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (t / y) - y;
double tmp;
if (y <= -2.5e-72) {
tmp = x + ((t_1 * 0.3333333333333333) / z);
} else if (y <= 2.1e-154) {
tmp = x + ((t * (0.3333333333333333 / z)) / y);
} else {
tmp = x + (t_1 / (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) :: t_1
real(8) :: tmp
t_1 = (t / y) - y
if (y <= (-2.5d-72)) then
tmp = x + ((t_1 * 0.3333333333333333d0) / z)
else if (y <= 2.1d-154) then
tmp = x + ((t * (0.3333333333333333d0 / z)) / y)
else
tmp = x + (t_1 / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t / y) - y;
double tmp;
if (y <= -2.5e-72) {
tmp = x + ((t_1 * 0.3333333333333333) / z);
} else if (y <= 2.1e-154) {
tmp = x + ((t * (0.3333333333333333 / z)) / y);
} else {
tmp = x + (t_1 / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = (t / y) - y tmp = 0 if y <= -2.5e-72: tmp = x + ((t_1 * 0.3333333333333333) / z) elif y <= 2.1e-154: tmp = x + ((t * (0.3333333333333333 / z)) / y) else: tmp = x + (t_1 / (z * 3.0)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t / y) - y) tmp = 0.0 if (y <= -2.5e-72) tmp = Float64(x + Float64(Float64(t_1 * 0.3333333333333333) / z)); elseif (y <= 2.1e-154) tmp = Float64(x + Float64(Float64(t * Float64(0.3333333333333333 / z)) / y)); else tmp = Float64(x + Float64(t_1 / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t / y) - y; tmp = 0.0; if (y <= -2.5e-72) tmp = x + ((t_1 * 0.3333333333333333) / z); elseif (y <= 2.1e-154) tmp = x + ((t * (0.3333333333333333 / z)) / y); else tmp = x + (t_1 / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[y, -2.5e-72], N[(x + N[(N[(t$95$1 * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-154], N[(x + N[(N[(t * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$1 / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{y} - y\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{-72}:\\
\;\;\;\;x + \frac{t\_1 \cdot 0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-154}:\\
\;\;\;\;x + \frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t\_1}{z \cdot 3}\\
\end{array}
\end{array}
if y < -2.4999999999999998e-72Initial program 98.6%
+-commutative98.6%
associate-+r-98.6%
+-commutative98.6%
associate--l+98.6%
sub-neg98.6%
remove-double-neg98.6%
distribute-frac-neg98.6%
distribute-neg-in98.6%
remove-double-neg98.6%
sub-neg98.6%
neg-mul-198.6%
times-frac98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
*-commutative98.7%
Simplified98.6%
associate-*l/98.7%
Applied egg-rr98.7%
if -2.4999999999999998e-72 < y < 2.09999999999999984e-154Initial program 90.5%
+-commutative90.5%
associate-+r-90.5%
+-commutative90.5%
associate--l+90.5%
sub-neg90.5%
remove-double-neg90.5%
distribute-frac-neg90.5%
distribute-neg-in90.5%
remove-double-neg90.5%
sub-neg90.5%
neg-mul-190.5%
times-frac87.2%
distribute-frac-neg87.2%
neg-mul-187.2%
*-commutative87.2%
associate-/l*87.2%
*-commutative87.2%
Simplified87.1%
Taylor expanded in t around inf 90.2%
associate-*r/90.1%
*-commutative90.1%
times-frac86.8%
*-commutative86.8%
associate-*l/97.0%
Simplified97.0%
if 2.09999999999999984e-154 < y Initial program 96.7%
+-commutative96.7%
associate-+r-96.7%
+-commutative96.7%
associate--l+96.7%
sub-neg96.7%
remove-double-neg96.7%
distribute-frac-neg96.7%
distribute-neg-in96.7%
remove-double-neg96.7%
sub-neg96.7%
neg-mul-196.7%
times-frac98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
*-commutative98.7%
Simplified98.7%
*-commutative98.7%
clear-num98.6%
div-inv98.7%
metadata-eval98.7%
un-div-inv98.7%
Applied egg-rr98.7%
Final simplification98.2%
(FPCore (x y z t) :precision binary64 (if (<= t 6e-49) (+ x (/ (- (/ t y) y) (* z 3.0))) (+ (+ x (/ t (* z (* y 3.0)))) (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6e-49) {
tmp = x + (((t / y) - y) / (z * 3.0));
} else {
tmp = (x + (t / (z * (y * 3.0)))) + (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 (t <= 6d-49) then
tmp = x + (((t / y) - y) / (z * 3.0d0))
else
tmp = (x + (t / (z * (y * 3.0d0)))) + (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 (t <= 6e-49) {
tmp = x + (((t / y) - y) / (z * 3.0));
} else {
tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 6e-49: tmp = x + (((t / y) - y) / (z * 3.0)) else: tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 6e-49) tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); else tmp = Float64(Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))) + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 6e-49) tmp = x + (((t / y) - y) / (z * 3.0)); else tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 6e-49], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right) + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if t < 6e-49Initial program 93.8%
+-commutative93.8%
associate-+r-93.8%
+-commutative93.8%
associate--l+93.8%
sub-neg93.8%
remove-double-neg93.8%
distribute-frac-neg93.8%
distribute-neg-in93.8%
remove-double-neg93.8%
sub-neg93.8%
neg-mul-193.8%
times-frac98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
*-commutative98.7%
Simplified98.7%
*-commutative98.7%
clear-num98.7%
div-inv98.7%
metadata-eval98.7%
un-div-inv98.7%
Applied egg-rr98.7%
if 6e-49 < t Initial program 98.7%
+-commutative98.7%
associate-+r-98.7%
sub-neg98.7%
associate-*l*98.7%
*-commutative98.7%
distribute-frac-neg298.7%
distribute-rgt-neg-in98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -140.0)
(- x (/ (/ y z) 3.0))
(if (<= y 8.2e+99)
(+ x (/ (* t (/ 0.3333333333333333 z)) y))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -140.0) {
tmp = x - ((y / z) / 3.0);
} else if (y <= 8.2e+99) {
tmp = x + ((t * (0.3333333333333333 / 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 <= (-140.0d0)) then
tmp = x - ((y / z) / 3.0d0)
else if (y <= 8.2d+99) then
tmp = x + ((t * (0.3333333333333333d0 / 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 <= -140.0) {
tmp = x - ((y / z) / 3.0);
} else if (y <= 8.2e+99) {
tmp = x + ((t * (0.3333333333333333 / z)) / y);
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -140.0: tmp = x - ((y / z) / 3.0) elif y <= 8.2e+99: tmp = x + ((t * (0.3333333333333333 / z)) / y) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -140.0) tmp = Float64(x - Float64(Float64(y / z) / 3.0)); elseif (y <= 8.2e+99) tmp = Float64(x + Float64(Float64(t * Float64(0.3333333333333333 / z)) / y)); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -140.0) tmp = x - ((y / z) / 3.0); elseif (y <= 8.2e+99) tmp = x + ((t * (0.3333333333333333 / z)) / y); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -140.0], N[(x - N[(N[(y / z), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+99], N[(x + N[(N[(t * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -140:\\
\;\;\;\;x - \frac{\frac{y}{z}}{3}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+99}:\\
\;\;\;\;x + \frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -140Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.8%
*-commutative99.8%
Simplified99.7%
Taylor expanded in t around 0 94.2%
neg-mul-194.2%
Simplified94.2%
distribute-rgt-neg-out94.2%
distribute-lft-neg-in94.2%
add-sqr-sqrt0.0%
sqrt-unprod15.3%
sqr-neg15.3%
sqrt-unprod22.6%
add-sqr-sqrt22.6%
cancel-sign-sub-inv22.6%
*-commutative22.6%
add-sqr-sqrt22.6%
sqrt-unprod15.3%
sqr-neg15.3%
sqrt-unprod0.0%
add-sqr-sqrt94.2%
Applied egg-rr94.2%
Taylor expanded in x around 0 94.2%
*-commutative94.2%
metadata-eval94.2%
div-inv94.3%
Applied egg-rr94.3%
if -140 < y < 8.19999999999999959e99Initial program 91.9%
+-commutative91.9%
associate-+r-91.9%
+-commutative91.9%
associate--l+91.9%
sub-neg91.9%
remove-double-neg91.9%
distribute-frac-neg91.9%
distribute-neg-in91.9%
remove-double-neg91.9%
sub-neg91.9%
neg-mul-191.9%
times-frac91.3%
distribute-frac-neg91.3%
neg-mul-191.3%
*-commutative91.3%
associate-/l*91.3%
*-commutative91.3%
Simplified91.2%
Taylor expanded in t around inf 85.4%
associate-*r/85.4%
*-commutative85.4%
times-frac84.7%
*-commutative84.7%
associate-*l/91.9%
Simplified91.9%
if 8.19999999999999959e99 < y Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
sub-neg99.9%
associate-*l*99.9%
*-commutative99.9%
distribute-frac-neg299.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
associate-/r*91.0%
div-inv91.0%
Applied egg-rr91.0%
Taylor expanded in t around 0 99.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -270.0)
(- x (/ (/ y z) 3.0))
(if (<= y 8.2e+99)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(+ x (/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -270.0) {
tmp = x - ((y / z) / 3.0);
} else if (y <= 8.2e+99) {
tmp = x + (0.3333333333333333 * (t / (y * 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 <= (-270.0d0)) then
tmp = x - ((y / z) / 3.0d0)
else if (y <= 8.2d+99) then
tmp = x + (0.3333333333333333d0 * (t / (y * 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 <= -270.0) {
tmp = x - ((y / z) / 3.0);
} else if (y <= 8.2e+99) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x + (y / (z * -3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -270.0: tmp = x - ((y / z) / 3.0) elif y <= 8.2e+99: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x + (y / (z * -3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -270.0) tmp = Float64(x - Float64(Float64(y / z) / 3.0)); elseif (y <= 8.2e+99) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x + Float64(y / Float64(z * -3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -270.0) tmp = x - ((y / z) / 3.0); elseif (y <= 8.2e+99) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x + (y / (z * -3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -270.0], N[(x - N[(N[(y / z), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+99], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -270:\\
\;\;\;\;x - \frac{\frac{y}{z}}{3}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+99}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -270Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate--l+99.8%
sub-neg99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.8%
*-commutative99.8%
Simplified99.7%
Taylor expanded in t around 0 94.2%
neg-mul-194.2%
Simplified94.2%
distribute-rgt-neg-out94.2%
distribute-lft-neg-in94.2%
add-sqr-sqrt0.0%
sqrt-unprod15.3%
sqr-neg15.3%
sqrt-unprod22.6%
add-sqr-sqrt22.6%
cancel-sign-sub-inv22.6%
*-commutative22.6%
add-sqr-sqrt22.6%
sqrt-unprod15.3%
sqr-neg15.3%
sqrt-unprod0.0%
add-sqr-sqrt94.2%
Applied egg-rr94.2%
Taylor expanded in x around 0 94.2%
*-commutative94.2%
metadata-eval94.2%
div-inv94.3%
Applied egg-rr94.3%
if -270 < y < 8.19999999999999959e99Initial program 91.9%
+-commutative91.9%
associate-+r-91.9%
+-commutative91.9%
associate--l+91.9%
sub-neg91.9%
remove-double-neg91.9%
distribute-frac-neg91.9%
distribute-neg-in91.9%
remove-double-neg91.9%
sub-neg91.9%
neg-mul-191.9%
times-frac91.3%
distribute-frac-neg91.3%
neg-mul-191.3%
*-commutative91.3%
associate-/l*91.3%
*-commutative91.3%
Simplified91.2%
Taylor expanded in t around inf 85.4%
if 8.19999999999999959e99 < y Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
sub-neg99.9%
associate-*l*99.9%
*-commutative99.9%
distribute-frac-neg299.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
associate-/r*91.0%
div-inv91.0%
Applied egg-rr91.0%
Taylor expanded in t around 0 99.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(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 95.4%
+-commutative95.4%
associate-+r-95.4%
+-commutative95.4%
associate--l+95.4%
sub-neg95.4%
remove-double-neg95.4%
distribute-frac-neg95.4%
distribute-neg-in95.4%
remove-double-neg95.4%
sub-neg95.4%
neg-mul-195.4%
times-frac95.1%
distribute-frac-neg95.1%
neg-mul-195.1%
*-commutative95.1%
associate-/l*95.1%
*-commutative95.1%
Simplified95.0%
Taylor expanded in t around 0 63.3%
neg-mul-163.3%
Simplified63.3%
distribute-rgt-neg-out63.3%
distribute-lft-neg-in63.3%
add-sqr-sqrt28.3%
sqrt-unprod33.0%
sqr-neg33.0%
sqrt-unprod15.1%
add-sqr-sqrt27.9%
cancel-sign-sub-inv27.9%
*-commutative27.9%
add-sqr-sqrt15.1%
sqrt-unprod33.0%
sqr-neg33.0%
sqrt-unprod28.3%
add-sqr-sqrt63.3%
Applied egg-rr63.3%
Taylor expanded in x around 0 63.2%
*-commutative63.2%
metadata-eval63.2%
div-inv63.3%
Applied egg-rr63.3%
(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(Float64(y * -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[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot -0.3333333333333333}{z}
\end{array}
Initial program 95.4%
+-commutative95.4%
associate-+r-95.4%
+-commutative95.4%
associate--l+95.4%
sub-neg95.4%
remove-double-neg95.4%
distribute-frac-neg95.4%
distribute-neg-in95.4%
remove-double-neg95.4%
sub-neg95.4%
neg-mul-195.4%
times-frac95.1%
distribute-frac-neg95.1%
neg-mul-195.1%
*-commutative95.1%
associate-/l*95.1%
*-commutative95.1%
Simplified95.0%
Taylor expanded in t around 0 63.3%
neg-mul-163.3%
Simplified63.3%
Taylor expanded in z around 0 63.2%
associate-*r/63.3%
*-commutative63.3%
Simplified63.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(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.4%
+-commutative95.4%
associate-+r-95.4%
sub-neg95.4%
associate-*l*95.4%
*-commutative95.4%
distribute-frac-neg295.4%
distribute-rgt-neg-in95.4%
metadata-eval95.4%
Simplified95.4%
associate-/r*95.2%
div-inv95.2%
Applied egg-rr95.2%
Taylor expanded in t around 0 63.3%
(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.4%
+-commutative95.4%
associate-+r-95.4%
+-commutative95.4%
associate--l+95.4%
sub-neg95.4%
remove-double-neg95.4%
distribute-frac-neg95.4%
distribute-neg-in95.4%
remove-double-neg95.4%
sub-neg95.4%
neg-mul-195.4%
times-frac95.1%
distribute-frac-neg95.1%
neg-mul-195.1%
*-commutative95.1%
associate-/l*95.1%
*-commutative95.1%
Simplified95.0%
Taylor expanded in x around inf 28.5%
(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 2024119
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))