
(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 (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (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 / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); end
code[x_, y_, z_, t_] := 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}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}
\end{array}
Initial program 98.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= x -9e+34)
x
(if (or (<= x 1.75e+43) (and (not (<= x 1.7e+132)) (<= x 5.5e+236)))
(* (/ y z) -0.3333333333333333)
x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9e+34) {
tmp = x;
} else if ((x <= 1.75e+43) || (!(x <= 1.7e+132) && (x <= 5.5e+236))) {
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 <= (-9d+34)) then
tmp = x
else if ((x <= 1.75d+43) .or. (.not. (x <= 1.7d+132)) .and. (x <= 5.5d+236)) 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 <= -9e+34) {
tmp = x;
} else if ((x <= 1.75e+43) || (!(x <= 1.7e+132) && (x <= 5.5e+236))) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9e+34: tmp = x elif (x <= 1.75e+43) or (not (x <= 1.7e+132) and (x <= 5.5e+236)): tmp = (y / z) * -0.3333333333333333 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9e+34) tmp = x; elseif ((x <= 1.75e+43) || (!(x <= 1.7e+132) && (x <= 5.5e+236))) 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 <= -9e+34) tmp = x; elseif ((x <= 1.75e+43) || (~((x <= 1.7e+132)) && (x <= 5.5e+236))) tmp = (y / z) * -0.3333333333333333; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9e+34], x, If[Or[LessEqual[x, 1.75e+43], And[N[Not[LessEqual[x, 1.7e+132]], $MachinePrecision], LessEqual[x, 5.5e+236]]], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+43} \lor \neg \left(x \leq 1.7 \cdot 10^{+132}\right) \land x \leq 5.5 \cdot 10^{+236}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.0000000000000001e34 or 1.7500000000000001e43 < x < 1.70000000000000013e132 or 5.5e236 < x 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.9%
*-commutative99.9%
neg-mul-199.9%
times-frac98.9%
distribute-lft-out--99.0%
*-commutative99.0%
associate-/r*99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in x around inf 59.7%
if -9.0000000000000001e34 < x < 1.7500000000000001e43 or 1.70000000000000013e132 < x < 5.5e236Initial program 97.9%
sub-neg97.9%
associate-+l+97.9%
remove-double-neg97.9%
distribute-frac-neg97.9%
sub-neg97.9%
distribute-frac-neg97.9%
neg-mul-197.9%
*-commutative97.9%
associate-/l*97.9%
*-commutative97.9%
neg-mul-197.9%
times-frac95.5%
distribute-lft-out--95.5%
*-commutative95.5%
associate-/r*95.5%
metadata-eval95.5%
Simplified95.5%
Taylor expanded in y around inf 60.7%
cancel-sign-sub-inv60.7%
metadata-eval60.7%
associate-*r/60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in x around 0 50.0%
Taylor expanded in y around 0 49.9%
Final simplification53.7%
(FPCore (x y z t)
:precision binary64
(if (<= x -5.9e+32)
x
(if (<= x 5.5e+48)
(* y (/ -0.3333333333333333 z))
(if (<= x 2.1e+132)
x
(if (<= x 5.5e+236) (* (/ y z) -0.3333333333333333) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.9e+32) {
tmp = x;
} else if (x <= 5.5e+48) {
tmp = y * (-0.3333333333333333 / z);
} else if (x <= 2.1e+132) {
tmp = x;
} else if (x <= 5.5e+236) {
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 <= (-5.9d+32)) then
tmp = x
else if (x <= 5.5d+48) then
tmp = y * ((-0.3333333333333333d0) / z)
else if (x <= 2.1d+132) then
tmp = x
else if (x <= 5.5d+236) 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 <= -5.9e+32) {
tmp = x;
} else if (x <= 5.5e+48) {
tmp = y * (-0.3333333333333333 / z);
} else if (x <= 2.1e+132) {
tmp = x;
} else if (x <= 5.5e+236) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.9e+32: tmp = x elif x <= 5.5e+48: tmp = y * (-0.3333333333333333 / z) elif x <= 2.1e+132: tmp = x elif x <= 5.5e+236: tmp = (y / z) * -0.3333333333333333 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.9e+32) tmp = x; elseif (x <= 5.5e+48) tmp = Float64(y * Float64(-0.3333333333333333 / z)); elseif (x <= 2.1e+132) tmp = x; elseif (x <= 5.5e+236) 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 <= -5.9e+32) tmp = x; elseif (x <= 5.5e+48) tmp = y * (-0.3333333333333333 / z); elseif (x <= 2.1e+132) tmp = x; elseif (x <= 5.5e+236) tmp = (y / z) * -0.3333333333333333; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.9e+32], x, If[LessEqual[x, 5.5e+48], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e+132], x, If[LessEqual[x, 5.5e+236], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.9 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+132}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+236}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.89999999999999965e32 or 5.5000000000000002e48 < x < 2.09999999999999993e132 or 5.5e236 < x 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.9%
*-commutative99.9%
neg-mul-199.9%
times-frac98.9%
distribute-lft-out--99.0%
*-commutative99.0%
associate-/r*99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in x around inf 59.7%
if -5.89999999999999965e32 < x < 5.5000000000000002e48Initial program 98.4%
sub-neg98.4%
associate-+l+98.4%
remove-double-neg98.4%
distribute-frac-neg98.4%
sub-neg98.4%
distribute-frac-neg98.4%
neg-mul-198.4%
*-commutative98.4%
associate-/l*98.3%
*-commutative98.3%
neg-mul-198.3%
times-frac95.0%
distribute-lft-out--95.0%
*-commutative95.0%
associate-/r*95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in y around inf 58.4%
cancel-sign-sub-inv58.4%
metadata-eval58.4%
associate-*r/58.5%
metadata-eval58.5%
Simplified58.5%
Taylor expanded in x around 0 49.1%
if 2.09999999999999993e132 < x < 5.5e236Initial program 94.3%
sub-neg94.3%
associate-+l+94.3%
remove-double-neg94.3%
distribute-frac-neg94.3%
sub-neg94.3%
distribute-frac-neg94.3%
neg-mul-194.3%
*-commutative94.3%
associate-/l*94.2%
*-commutative94.2%
neg-mul-194.2%
times-frac99.6%
distribute-lft-out--99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 79.3%
cancel-sign-sub-inv79.3%
metadata-eval79.3%
associate-*r/79.2%
metadata-eval79.2%
Simplified79.2%
Taylor expanded in x around 0 57.4%
Taylor expanded in y around 0 57.6%
Final simplification53.7%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.7e+34)
x
(if (<= x 3e+49)
(* y (/ -0.3333333333333333 z))
(if (<= x 2.2e+132) x (if (<= x 5.5e+236) (/ y (* z -3.0)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.7e+34) {
tmp = x;
} else if (x <= 3e+49) {
tmp = y * (-0.3333333333333333 / z);
} else if (x <= 2.2e+132) {
tmp = x;
} else if (x <= 5.5e+236) {
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.7d+34)) then
tmp = x
else if (x <= 3d+49) then
tmp = y * ((-0.3333333333333333d0) / z)
else if (x <= 2.2d+132) then
tmp = x
else if (x <= 5.5d+236) 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.7e+34) {
tmp = x;
} else if (x <= 3e+49) {
tmp = y * (-0.3333333333333333 / z);
} else if (x <= 2.2e+132) {
tmp = x;
} else if (x <= 5.5e+236) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.7e+34: tmp = x elif x <= 3e+49: tmp = y * (-0.3333333333333333 / z) elif x <= 2.2e+132: tmp = x elif x <= 5.5e+236: tmp = y / (z * -3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.7e+34) tmp = x; elseif (x <= 3e+49) tmp = Float64(y * Float64(-0.3333333333333333 / z)); elseif (x <= 2.2e+132) tmp = x; elseif (x <= 5.5e+236) tmp = Float64(y / Float64(z * -3.0)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.7e+34) tmp = x; elseif (x <= 3e+49) tmp = y * (-0.3333333333333333 / z); elseif (x <= 2.2e+132) tmp = x; elseif (x <= 5.5e+236) tmp = y / (z * -3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.7e+34], x, If[LessEqual[x, 3e+49], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e+132], x, If[LessEqual[x, 5.5e+236], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+49}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+132}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+236}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.7e34 or 3.0000000000000002e49 < x < 2.19999999999999989e132 or 5.5e236 < x 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.9%
*-commutative99.9%
neg-mul-199.9%
times-frac98.9%
distribute-lft-out--99.0%
*-commutative99.0%
associate-/r*99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in x around inf 59.7%
if -1.7e34 < x < 3.0000000000000002e49Initial program 98.4%
sub-neg98.4%
associate-+l+98.4%
remove-double-neg98.4%
distribute-frac-neg98.4%
sub-neg98.4%
distribute-frac-neg98.4%
neg-mul-198.4%
*-commutative98.4%
associate-/l*98.3%
*-commutative98.3%
neg-mul-198.3%
times-frac95.0%
distribute-lft-out--95.0%
*-commutative95.0%
associate-/r*95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in y around inf 58.4%
cancel-sign-sub-inv58.4%
metadata-eval58.4%
associate-*r/58.5%
metadata-eval58.5%
Simplified58.5%
Taylor expanded in x around 0 49.1%
if 2.19999999999999989e132 < x < 5.5e236Initial program 94.3%
sub-neg94.3%
associate-+l+94.3%
remove-double-neg94.3%
distribute-frac-neg94.3%
sub-neg94.3%
distribute-frac-neg94.3%
neg-mul-194.3%
*-commutative94.3%
associate-/l*94.2%
*-commutative94.2%
neg-mul-194.2%
times-frac99.6%
distribute-lft-out--99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 79.3%
cancel-sign-sub-inv79.3%
metadata-eval79.3%
associate-*r/79.2%
metadata-eval79.2%
Simplified79.2%
Taylor expanded in x around 0 57.4%
clear-num57.4%
un-div-inv57.5%
div-inv57.7%
metadata-eval57.7%
Applied egg-rr57.7%
Final simplification53.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.2e+33)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 7800.0)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(- x (* 0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e+33) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 7800.0) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - (0.3333333333333333 * (y / 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.2d+33)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (y <= 7800.0d0) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x - (0.3333333333333333d0 * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e+33) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 7800.0) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.2e+33: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 7800.0: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x - (0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.2e+33) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 7800.0) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.2e+33) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 7800.0) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x - (0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.2e+33], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7800.0], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+33}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 7800:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -2.19999999999999994e33Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
sub-neg99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
*-commutative99.7%
neg-mul-199.7%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 93.7%
if -2.19999999999999994e33 < y < 7800Initial program 97.6%
sub-neg97.6%
associate-+l+97.6%
remove-double-neg97.6%
distribute-frac-neg97.6%
sub-neg97.6%
distribute-frac-neg97.6%
neg-mul-197.6%
*-commutative97.6%
associate-/l*97.6%
*-commutative97.6%
neg-mul-197.6%
times-frac93.9%
distribute-lft-out--93.9%
*-commutative93.9%
associate-/r*93.9%
metadata-eval93.9%
Simplified93.9%
Taylor expanded in y around 0 90.0%
if 7800 < y Initial program 99.8%
Taylor expanded in t around 0 98.3%
Final simplification93.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.2e+33)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 0.072)
(+ x (/ (* 0.3333333333333333 (/ t z)) y))
(- x (* 0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e+33) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 0.072) {
tmp = x + ((0.3333333333333333 * (t / z)) / y);
} else {
tmp = x - (0.3333333333333333 * (y / 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 <= (-1.2d+33)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (y <= 0.072d0) then
tmp = x + ((0.3333333333333333d0 * (t / z)) / y)
else
tmp = x - (0.3333333333333333d0 * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e+33) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 0.072) {
tmp = x + ((0.3333333333333333 * (t / z)) / y);
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.2e+33: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 0.072: tmp = x + ((0.3333333333333333 * (t / z)) / y) else: tmp = x - (0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.2e+33) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 0.072) tmp = Float64(x + Float64(Float64(0.3333333333333333 * Float64(t / z)) / y)); else tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.2e+33) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 0.072) tmp = x + ((0.3333333333333333 * (t / z)) / y); else tmp = x - (0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.2e+33], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.072], N[(x + N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+33}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 0.072:\\
\;\;\;\;x + \frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -1.2e33Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
sub-neg99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
*-commutative99.7%
neg-mul-199.7%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 93.7%
if -1.2e33 < y < 0.0719999999999999946Initial program 97.6%
sub-neg97.6%
associate-+l+97.6%
remove-double-neg97.6%
distribute-frac-neg97.6%
sub-neg97.6%
distribute-frac-neg97.6%
neg-mul-197.6%
*-commutative97.6%
associate-/l*97.6%
*-commutative97.6%
neg-mul-197.6%
times-frac93.9%
distribute-lft-out--93.9%
*-commutative93.9%
associate-/r*93.9%
metadata-eval93.9%
Simplified93.9%
div-inv93.9%
Applied egg-rr93.9%
Taylor expanded in y around 0 90.0%
associate-*r/90.0%
*-commutative90.0%
associate-/r*91.2%
Simplified91.2%
associate-*r/91.2%
*-commutative91.2%
Applied egg-rr91.2%
if 0.0719999999999999946 < y Initial program 99.8%
Taylor expanded in t around 0 98.3%
Final simplification93.7%
(FPCore (x y z t) :precision binary64 (+ (+ x (/ t (* z (* y 3.0)))) (/ y (* z -3.0))))
double code(double x, double y, double z, double t) {
return (x + (t / (z * (y * 3.0)))) + (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 + (t / (z * (y * 3.0d0)))) + (y / (z * (-3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
}
def code(x, y, z, t): return (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0))
function code(x, y, z, t) return Float64(Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))) + Float64(y / Float64(z * -3.0))) end
function tmp = code(x, y, z, t) tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0)); end
code[x_, y_, z_, t_] := 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}
\\
\left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right) + \frac{y}{z \cdot -3}
\end{array}
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 (+ x (* 0.3333333333333333 (- (/ t (* y z)) (/ y z)))))
double code(double x, double y, double z, double t) {
return x + (0.3333333333333333 * ((t / (y * z)) - (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 * ((t / (y * z)) - (y / z)))
end function
public static double code(double x, double y, double z, double t) {
return x + (0.3333333333333333 * ((t / (y * z)) - (y / z)));
}
def code(x, y, z, t): return x + (0.3333333333333333 * ((t / (y * z)) - (y / z)))
function code(x, y, z, t) return Float64(x + Float64(0.3333333333333333 * Float64(Float64(t / Float64(y * z)) - Float64(y / z)))) end
function tmp = code(x, y, z, t) tmp = x + (0.3333333333333333 * ((t / (y * z)) - (y / z))); end
code[x_, y_, z_, t_] := N[(x + N[(0.3333333333333333 * N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 0.3333333333333333 \cdot \left(\frac{t}{y \cdot z} - \frac{y}{z}\right)
\end{array}
Initial program 98.7%
sub-neg98.7%
associate-+l+98.7%
remove-double-neg98.7%
distribute-frac-neg98.7%
sub-neg98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
*-commutative98.7%
neg-mul-198.7%
times-frac96.8%
distribute-lft-out--96.8%
*-commutative96.8%
associate-/r*96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in t around 0 98.6%
+-commutative98.6%
+-commutative98.6%
metadata-eval98.6%
cancel-sign-sub-inv98.6%
distribute-lft-out--98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (x y z t) :precision binary64 (+ x (* (/ -0.3333333333333333 z) (- y (/ t y)))))
double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 / 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) / z) * (y - (t / y)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 / z) * (y - (t / y)));
}
def code(x, y, z, t): return x + ((-0.3333333333333333 / z) * (y - (t / y)))
function code(x, y, z, t) return Float64(x + Float64(Float64(-0.3333333333333333 / z) * Float64(y - Float64(t / y)))) end
function tmp = code(x, y, z, t) tmp = x + ((-0.3333333333333333 / z) * (y - (t / y))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 / z), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)
\end{array}
Initial program 98.7%
sub-neg98.7%
associate-+l+98.7%
remove-double-neg98.7%
distribute-frac-neg98.7%
sub-neg98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
*-commutative98.7%
neg-mul-198.7%
times-frac96.8%
distribute-lft-out--96.8%
*-commutative96.8%
associate-/r*96.8%
metadata-eval96.8%
Simplified96.8%
Final simplification96.8%
(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 98.7%
sub-neg98.7%
associate-+l+98.7%
remove-double-neg98.7%
distribute-frac-neg98.7%
sub-neg98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
*-commutative98.7%
neg-mul-198.7%
times-frac96.8%
distribute-lft-out--96.8%
*-commutative96.8%
associate-/r*96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in y around inf 67.1%
Final simplification67.1%
(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 98.7%
sub-neg98.7%
associate-+l+98.7%
remove-double-neg98.7%
distribute-frac-neg98.7%
sub-neg98.7%
distribute-frac-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
*-commutative98.7%
neg-mul-198.7%
times-frac96.8%
distribute-lft-out--96.8%
*-commutative96.8%
associate-/r*96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in x around inf 30.0%
Final simplification30.0%
(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 2024089
(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))))