
(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 15 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) -5e+23) (+ (- x (/ y (* z 3.0))) (/ t (* z (* 3.0 y)))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -5e+23) {
tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y)));
} else {
tmp = x + (((t / y) - 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 ((z * 3.0d0) <= (-5d+23)) then
tmp = (x - (y / (z * 3.0d0))) + (t / (z * (3.0d0 * y)))
else
tmp = x + (((t / y) - 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 ((z * 3.0) <= -5e+23) {
tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y)));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -5e+23: tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y))) else: tmp = x + (((t / y) - y) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -5e+23) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(z * Float64(3.0 * y)))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -5e+23) tmp = (x - (y / (z * 3.0))) + (t / (z * (3.0 * y))); else tmp = x + (((t / y) - y) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -5e+23], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z * N[(3.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -5 \cdot 10^{+23}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(3 \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (*.f64 z 3) < -4.9999999999999999e23Initial program 99.7%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
if -4.9999999999999999e23 < (*.f64 z 3) Initial program 94.0%
associate-*l*94.0%
*-commutative94.0%
Simplified94.0%
associate-+l-94.0%
*-commutative94.0%
associate-*l*94.0%
associate-/l/97.3%
sub-div98.3%
Applied egg-rr98.3%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* 0.3333333333333333 (/ y z)))))
(if (<= y -5.5e+78)
t_1
(if (<= y -2.95e+19)
(/ (* 0.3333333333333333 (- (/ t y) y)) z)
(if (<= y -0.00092)
t_1
(if (<= y 3.6e+72)
(+ x (* (/ t z) (/ 0.3333333333333333 y)))
(+ x (* (/ y 3.0) (/ -1.0 z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -5.5e+78) {
tmp = t_1;
} else if (y <= -2.95e+19) {
tmp = (0.3333333333333333 * ((t / y) - y)) / z;
} else if (y <= -0.00092) {
tmp = t_1;
} else if (y <= 3.6e+72) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + ((y / 3.0) * (-1.0 / 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) :: t_1
real(8) :: tmp
t_1 = x - (0.3333333333333333d0 * (y / z))
if (y <= (-5.5d+78)) then
tmp = t_1
else if (y <= (-2.95d+19)) then
tmp = (0.3333333333333333d0 * ((t / y) - y)) / z
else if (y <= (-0.00092d0)) then
tmp = t_1
else if (y <= 3.6d+72) then
tmp = x + ((t / z) * (0.3333333333333333d0 / y))
else
tmp = x + ((y / 3.0d0) * ((-1.0d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (0.3333333333333333 * (y / z));
double tmp;
if (y <= -5.5e+78) {
tmp = t_1;
} else if (y <= -2.95e+19) {
tmp = (0.3333333333333333 * ((t / y) - y)) / z;
} else if (y <= -0.00092) {
tmp = t_1;
} else if (y <= 3.6e+72) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + ((y / 3.0) * (-1.0 / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (0.3333333333333333 * (y / z)) tmp = 0 if y <= -5.5e+78: tmp = t_1 elif y <= -2.95e+19: tmp = (0.3333333333333333 * ((t / y) - y)) / z elif y <= -0.00092: tmp = t_1 elif y <= 3.6e+72: tmp = x + ((t / z) * (0.3333333333333333 / y)) else: tmp = x + ((y / 3.0) * (-1.0 / z)) return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(0.3333333333333333 * Float64(y / z))) tmp = 0.0 if (y <= -5.5e+78) tmp = t_1; elseif (y <= -2.95e+19) tmp = Float64(Float64(0.3333333333333333 * Float64(Float64(t / y) - y)) / z); elseif (y <= -0.00092) tmp = t_1; elseif (y <= 3.6e+72) tmp = Float64(x + Float64(Float64(t / z) * Float64(0.3333333333333333 / y))); else tmp = Float64(x + Float64(Float64(y / 3.0) * Float64(-1.0 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (0.3333333333333333 * (y / z)); tmp = 0.0; if (y <= -5.5e+78) tmp = t_1; elseif (y <= -2.95e+19) tmp = (0.3333333333333333 * ((t / y) - y)) / z; elseif (y <= -0.00092) tmp = t_1; elseif (y <= 3.6e+72) tmp = x + ((t / z) * (0.3333333333333333 / y)); else tmp = x + ((y / 3.0) * (-1.0 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+78], t$95$1, If[LessEqual[y, -2.95e+19], N[(N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, -0.00092], t$95$1, If[LessEqual[y, 3.6e+72], N[(x + N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / 3.0), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.95 \cdot 10^{+19}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}\\
\mathbf{elif}\;y \leq -0.00092:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+72}:\\
\;\;\;\;x + \frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{3} \cdot \frac{-1}{z}\\
\end{array}
\end{array}
if y < -5.4999999999999997e78 or -2.95e19 < y < -9.2000000000000003e-4Initial program 99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 99.1%
if -5.4999999999999997e78 < y < -2.95e19Initial program 93.6%
*-un-lft-identity93.6%
times-frac93.1%
Applied egg-rr93.1%
clear-num93.2%
inv-pow93.2%
*-commutative93.2%
Applied egg-rr93.2%
unpow-193.2%
associate-*r*93.2%
Simplified93.2%
Taylor expanded in x around 0 93.6%
distribute-lft-out--93.6%
associate-/r*99.7%
distribute-lft-out--99.7%
associate-*r/99.4%
associate-*r/99.4%
div-sub99.4%
distribute-lft-out--99.4%
Simplified99.4%
if -9.2000000000000003e-4 < y < 3.60000000000000035e72Initial program 93.1%
Simplified94.3%
Taylor expanded in t around inf 86.3%
*-commutative86.3%
*-commutative86.3%
associate-/r*89.6%
metadata-eval89.6%
times-frac89.7%
associate-*r/89.7%
associate-/r*89.6%
associate-/l/89.7%
associate-/r*89.7%
metadata-eval89.7%
Simplified89.7%
if 3.60000000000000035e72 < y Initial program 97.6%
associate-*l*97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in t around 0 95.5%
metadata-eval95.5%
times-frac95.5%
*-commutative95.5%
*-un-lft-identity95.5%
Applied egg-rr95.5%
*-un-lft-identity97.6%
times-frac97.6%
Applied egg-rr95.6%
Final simplification93.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -0.0285)
(/ y (* z -3.0))
(if (<= y 1.65e-99)
(* t (/ (/ 0.3333333333333333 y) z))
(if (<= y 3.3e+46) x (/ (* y -0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.0285) {
tmp = y / (z * -3.0);
} else if (y <= 1.65e-99) {
tmp = t * ((0.3333333333333333 / y) / z);
} else if (y <= 3.3e+46) {
tmp = x;
} else {
tmp = (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 <= (-0.0285d0)) then
tmp = y / (z * (-3.0d0))
else if (y <= 1.65d-99) then
tmp = t * ((0.3333333333333333d0 / y) / z)
else if (y <= 3.3d+46) then
tmp = x
else
tmp = (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 <= -0.0285) {
tmp = y / (z * -3.0);
} else if (y <= 1.65e-99) {
tmp = t * ((0.3333333333333333 / y) / z);
} else if (y <= 3.3e+46) {
tmp = x;
} else {
tmp = (y * -0.3333333333333333) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -0.0285: tmp = y / (z * -3.0) elif y <= 1.65e-99: tmp = t * ((0.3333333333333333 / y) / z) elif y <= 3.3e+46: tmp = x else: tmp = (y * -0.3333333333333333) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -0.0285) tmp = Float64(y / Float64(z * -3.0)); elseif (y <= 1.65e-99) tmp = Float64(t * Float64(Float64(0.3333333333333333 / y) / z)); elseif (y <= 3.3e+46) tmp = x; else tmp = Float64(Float64(y * -0.3333333333333333) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -0.0285) tmp = y / (z * -3.0); elseif (y <= 1.65e-99) tmp = t * ((0.3333333333333333 / y) / z); elseif (y <= 3.3e+46) tmp = x; else tmp = (y * -0.3333333333333333) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.0285], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-99], N[(t * N[(N[(0.3333333333333333 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e+46], x, N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0285:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-99}:\\
\;\;\;\;t \cdot \frac{\frac{0.3333333333333333}{y}}{z}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+46}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -0.028500000000000001Initial program 98.5%
*-un-lft-identity98.5%
times-frac98.3%
Applied egg-rr98.3%
clear-num98.3%
inv-pow98.3%
*-commutative98.3%
Applied egg-rr98.3%
unpow-198.3%
associate-*r*98.3%
Simplified98.3%
Taylor expanded in y around inf 71.2%
associate-*r/71.1%
associate-/l*71.1%
associate-/r/71.1%
Simplified71.1%
*-commutative71.1%
clear-num71.0%
un-div-inv71.1%
div-inv71.2%
metadata-eval71.2%
Applied egg-rr71.2%
if -0.028500000000000001 < y < 1.64999999999999993e-99Initial program 92.2%
*-un-lft-identity92.2%
times-frac92.2%
Applied egg-rr92.2%
clear-num92.2%
inv-pow92.2%
*-commutative92.2%
Applied egg-rr92.2%
unpow-192.2%
associate-*r*92.2%
Simplified92.2%
Taylor expanded in y around 0 62.8%
associate-*r/62.9%
*-commutative62.9%
associate-*r/62.8%
associate-/r*62.8%
Simplified62.8%
if 1.64999999999999993e-99 < y < 3.2999999999999998e46Initial program 96.9%
associate-*l*96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in x around inf 57.0%
if 3.2999999999999998e46 < y Initial program 96.0%
associate-*l*96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in t around 0 88.8%
Taylor expanded in x around 0 57.0%
associate-*r/57.0%
Simplified57.0%
Final simplification63.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.85)
(/ y (* z -3.0))
(if (<= y 2.8e-104)
(* 0.3333333333333333 (/ (/ t y) z))
(if (<= y 1.65e+46) x (/ (* y -0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.85) {
tmp = y / (z * -3.0);
} else if (y <= 2.8e-104) {
tmp = 0.3333333333333333 * ((t / y) / z);
} else if (y <= 1.65e+46) {
tmp = x;
} else {
tmp = (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.85d0)) then
tmp = y / (z * (-3.0d0))
else if (y <= 2.8d-104) then
tmp = 0.3333333333333333d0 * ((t / y) / z)
else if (y <= 1.65d+46) then
tmp = x
else
tmp = (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.85) {
tmp = y / (z * -3.0);
} else if (y <= 2.8e-104) {
tmp = 0.3333333333333333 * ((t / y) / z);
} else if (y <= 1.65e+46) {
tmp = x;
} else {
tmp = (y * -0.3333333333333333) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.85: tmp = y / (z * -3.0) elif y <= 2.8e-104: tmp = 0.3333333333333333 * ((t / y) / z) elif y <= 1.65e+46: tmp = x else: tmp = (y * -0.3333333333333333) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.85) tmp = Float64(y / Float64(z * -3.0)); elseif (y <= 2.8e-104) tmp = Float64(0.3333333333333333 * Float64(Float64(t / y) / z)); elseif (y <= 1.65e+46) tmp = x; else tmp = Float64(Float64(y * -0.3333333333333333) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.85) tmp = y / (z * -3.0); elseif (y <= 2.8e-104) tmp = 0.3333333333333333 * ((t / y) / z); elseif (y <= 1.65e+46) tmp = x; else tmp = (y * -0.3333333333333333) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.85], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-104], N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+46], x, N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.85:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-104}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+46}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -2.85000000000000009Initial program 98.5%
*-un-lft-identity98.5%
times-frac98.3%
Applied egg-rr98.3%
clear-num98.3%
inv-pow98.3%
*-commutative98.3%
Applied egg-rr98.3%
unpow-198.3%
associate-*r*98.3%
Simplified98.3%
Taylor expanded in y around inf 71.2%
associate-*r/71.1%
associate-/l*71.1%
associate-/r/71.1%
Simplified71.1%
*-commutative71.1%
clear-num71.0%
un-div-inv71.1%
div-inv71.2%
metadata-eval71.2%
Applied egg-rr71.2%
if -2.85000000000000009 < y < 2.8e-104Initial program 92.2%
associate-*l*92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in y around 0 88.3%
+-commutative88.3%
Simplified88.3%
Taylor expanded in t around inf 62.8%
*-commutative62.8%
associate-/r*64.6%
Simplified64.6%
if 2.8e-104 < y < 1.6499999999999999e46Initial program 96.9%
associate-*l*96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in x around inf 57.0%
if 1.6499999999999999e46 < y Initial program 96.0%
associate-*l*96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in t around 0 88.8%
Taylor expanded in x around 0 57.0%
associate-*r/57.0%
Simplified57.0%
Final simplification63.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -0.00315) (not (<= y 4.4e+75))) (- x (/ y (* z 3.0))) (+ x (* (/ t z) (/ 0.3333333333333333 y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.00315) || !(y <= 4.4e+75)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x + ((t / z) * (0.3333333333333333 / 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 <= (-0.00315d0)) .or. (.not. (y <= 4.4d+75))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = x + ((t / z) * (0.3333333333333333d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.00315) || !(y <= 4.4e+75)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x + ((t / z) * (0.3333333333333333 / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -0.00315) or not (y <= 4.4e+75): tmp = x - (y / (z * 3.0)) else: tmp = x + ((t / z) * (0.3333333333333333 / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -0.00315) || !(y <= 4.4e+75)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(x + Float64(Float64(t / z) * Float64(0.3333333333333333 / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -0.00315) || ~((y <= 4.4e+75))) tmp = x - (y / (z * 3.0)); else tmp = x + ((t / z) * (0.3333333333333333 / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -0.00315], N[Not[LessEqual[y, 4.4e+75]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00315 \lor \neg \left(y \leq 4.4 \cdot 10^{+75}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\end{array}
\end{array}
if y < -0.00315 or 4.40000000000000024e75 < y Initial program 98.1%
associate-*l*98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in t around 0 93.6%
metadata-eval93.6%
times-frac93.6%
*-commutative93.6%
*-un-lft-identity93.6%
Applied egg-rr93.6%
if -0.00315 < y < 4.40000000000000024e75Initial program 93.1%
Simplified94.3%
Taylor expanded in t around inf 86.3%
*-commutative86.3%
*-commutative86.3%
associate-/r*89.6%
metadata-eval89.6%
times-frac89.7%
associate-*r/89.7%
associate-/r*89.6%
associate-/l/89.7%
associate-/r*89.7%
metadata-eval89.7%
Simplified89.7%
Final simplification91.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -0.57)
(- x (/ y (* z 3.0)))
(if (<= y 3.5e+72)
(+ x (* (/ t z) (/ 0.3333333333333333 y)))
(+ x (* (/ y 3.0) (/ -1.0 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.57) {
tmp = x - (y / (z * 3.0));
} else if (y <= 3.5e+72) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + ((y / 3.0) * (-1.0 / 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 <= (-0.57d0)) then
tmp = x - (y / (z * 3.0d0))
else if (y <= 3.5d+72) then
tmp = x + ((t / z) * (0.3333333333333333d0 / y))
else
tmp = x + ((y / 3.0d0) * ((-1.0d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.57) {
tmp = x - (y / (z * 3.0));
} else if (y <= 3.5e+72) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + ((y / 3.0) * (-1.0 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -0.57: tmp = x - (y / (z * 3.0)) elif y <= 3.5e+72: tmp = x + ((t / z) * (0.3333333333333333 / y)) else: tmp = x + ((y / 3.0) * (-1.0 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -0.57) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 3.5e+72) tmp = Float64(x + Float64(Float64(t / z) * Float64(0.3333333333333333 / y))); else tmp = Float64(x + Float64(Float64(y / 3.0) * Float64(-1.0 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -0.57) tmp = x - (y / (z * 3.0)); elseif (y <= 3.5e+72) tmp = x + ((t / z) * (0.3333333333333333 / y)); else tmp = x + ((y / 3.0) * (-1.0 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.57], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+72], N[(x + N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / 3.0), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.57:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+72}:\\
\;\;\;\;x + \frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{3} \cdot \frac{-1}{z}\\
\end{array}
\end{array}
if y < -0.569999999999999951Initial program 98.5%
associate-*l*98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in t around 0 92.4%
metadata-eval92.4%
times-frac92.4%
*-commutative92.4%
*-un-lft-identity92.4%
Applied egg-rr92.4%
if -0.569999999999999951 < y < 3.5000000000000001e72Initial program 93.1%
Simplified94.3%
Taylor expanded in t around inf 86.3%
*-commutative86.3%
*-commutative86.3%
associate-/r*89.6%
metadata-eval89.6%
times-frac89.7%
associate-*r/89.7%
associate-/r*89.6%
associate-/l/89.7%
associate-/r*89.7%
metadata-eval89.7%
Simplified89.7%
if 3.5000000000000001e72 < y Initial program 97.6%
associate-*l*97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in t around 0 95.5%
metadata-eval95.5%
times-frac95.5%
*-commutative95.5%
*-un-lft-identity95.5%
Applied egg-rr95.5%
*-un-lft-identity97.6%
times-frac97.6%
Applied egg-rr95.6%
Final simplification91.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.2e-179) (not (<= y 1.4e-106))) (- x (* 0.3333333333333333 (/ y z))) (* 0.3333333333333333 (/ (/ t y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.2e-179) || !(y <= 1.4e-106)) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = 0.3333333333333333 * ((t / 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 <= (-6.2d-179)) .or. (.not. (y <= 1.4d-106))) then
tmp = x - (0.3333333333333333d0 * (y / z))
else
tmp = 0.3333333333333333d0 * ((t / y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.2e-179) || !(y <= 1.4e-106)) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = 0.3333333333333333 * ((t / y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.2e-179) or not (y <= 1.4e-106): tmp = x - (0.3333333333333333 * (y / z)) else: tmp = 0.3333333333333333 * ((t / y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.2e-179) || !(y <= 1.4e-106)) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); else tmp = Float64(0.3333333333333333 * Float64(Float64(t / y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.2e-179) || ~((y <= 1.4e-106))) tmp = x - (0.3333333333333333 * (y / z)); else tmp = 0.3333333333333333 * ((t / y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.2e-179], N[Not[LessEqual[y, 1.4e-106]], $MachinePrecision]], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-179} \lor \neg \left(y \leq 1.4 \cdot 10^{-106}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\
\end{array}
\end{array}
if y < -6.2000000000000005e-179 or 1.39999999999999994e-106 < y Initial program 97.7%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in t around 0 79.4%
if -6.2000000000000005e-179 < y < 1.39999999999999994e-106Initial program 87.7%
associate-*l*87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in y around 0 87.7%
+-commutative87.7%
Simplified87.7%
Taylor expanded in t around inf 70.6%
*-commutative70.6%
associate-/r*76.3%
Simplified76.3%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.2e-179) (not (<= y 2.1e-103))) (- x (/ y (* z 3.0))) (* 0.3333333333333333 (/ (/ t y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.2e-179) || !(y <= 2.1e-103)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = 0.3333333333333333 * ((t / 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 <= (-6.2d-179)) .or. (.not. (y <= 2.1d-103))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = 0.3333333333333333d0 * ((t / y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.2e-179) || !(y <= 2.1e-103)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = 0.3333333333333333 * ((t / y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.2e-179) or not (y <= 2.1e-103): tmp = x - (y / (z * 3.0)) else: tmp = 0.3333333333333333 * ((t / y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.2e-179) || !(y <= 2.1e-103)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(0.3333333333333333 * Float64(Float64(t / y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.2e-179) || ~((y <= 2.1e-103))) tmp = x - (y / (z * 3.0)); else tmp = 0.3333333333333333 * ((t / y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.2e-179], N[Not[LessEqual[y, 2.1e-103]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-179} \lor \neg \left(y \leq 2.1 \cdot 10^{-103}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\
\end{array}
\end{array}
if y < -6.2000000000000005e-179 or 2.10000000000000005e-103 < y Initial program 97.7%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in t around 0 79.4%
metadata-eval79.4%
times-frac79.5%
*-commutative79.5%
*-un-lft-identity79.5%
Applied egg-rr79.5%
if -6.2000000000000005e-179 < y < 2.10000000000000005e-103Initial program 87.7%
associate-*l*87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in y around 0 87.7%
+-commutative87.7%
Simplified87.7%
Taylor expanded in t around inf 70.6%
*-commutative70.6%
associate-/r*76.3%
Simplified76.3%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.3e-179) (not (<= y 2.1e-99))) (- x (/ y (* z 3.0))) (/ 0.3333333333333333 (* z (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.3e-179) || !(y <= 2.1e-99)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = 0.3333333333333333 / (z * (y / 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 <= (-5.3d-179)) .or. (.not. (y <= 2.1d-99))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = 0.3333333333333333d0 / (z * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.3e-179) || !(y <= 2.1e-99)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = 0.3333333333333333 / (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.3e-179) or not (y <= 2.1e-99): tmp = x - (y / (z * 3.0)) else: tmp = 0.3333333333333333 / (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.3e-179) || !(y <= 2.1e-99)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(0.3333333333333333 / Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.3e-179) || ~((y <= 2.1e-99))) tmp = x - (y / (z * 3.0)); else tmp = 0.3333333333333333 / (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.3e-179], N[Not[LessEqual[y, 2.1e-99]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 / N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{-179} \lor \neg \left(y \leq 2.1 \cdot 10^{-99}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{z \cdot \frac{y}{t}}\\
\end{array}
\end{array}
if y < -5.29999999999999994e-179 or 2.09999999999999984e-99 < y Initial program 97.7%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in t around 0 79.4%
metadata-eval79.4%
times-frac79.5%
*-commutative79.5%
*-un-lft-identity79.5%
Applied egg-rr79.5%
if -5.29999999999999994e-179 < y < 2.09999999999999984e-99Initial program 87.7%
associate-*l*87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in y around 0 87.7%
+-commutative87.7%
Simplified87.7%
Taylor expanded in t around inf 70.6%
*-commutative70.6%
Simplified70.6%
associate-*l/70.6%
*-commutative70.6%
associate-/l*70.6%
*-commutative70.6%
*-un-lft-identity70.6%
times-frac76.8%
/-rgt-identity76.8%
Applied egg-rr76.8%
Final simplification78.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.2e-179) (not (<= y 1.7e-98))) (- x (/ y (* z 3.0))) (/ 0.3333333333333333 (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.2e-179) || !(y <= 1.7e-98)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = 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 <= (-6.2d-179)) .or. (.not. (y <= 1.7d-98))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = 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 <= -6.2e-179) || !(y <= 1.7e-98)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = 0.3333333333333333 / (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.2e-179) or not (y <= 1.7e-98): tmp = x - (y / (z * 3.0)) else: tmp = 0.3333333333333333 / (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.2e-179) || !(y <= 1.7e-98)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = 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 <= -6.2e-179) || ~((y <= 1.7e-98))) tmp = x - (y / (z * 3.0)); else tmp = 0.3333333333333333 / (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.2e-179], N[Not[LessEqual[y, 1.7e-98]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 / N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-179} \lor \neg \left(y \leq 1.7 \cdot 10^{-98}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\
\end{array}
\end{array}
if y < -6.2000000000000005e-179 or 1.7000000000000001e-98 < y Initial program 97.7%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in t around 0 79.4%
metadata-eval79.4%
times-frac79.5%
*-commutative79.5%
*-un-lft-identity79.5%
Applied egg-rr79.5%
if -6.2000000000000005e-179 < y < 1.7000000000000001e-98Initial program 87.7%
*-un-lft-identity87.7%
times-frac87.7%
Applied egg-rr87.7%
clear-num87.7%
inv-pow87.7%
*-commutative87.7%
Applied egg-rr87.7%
unpow-187.7%
associate-*r*87.7%
Simplified87.7%
Taylor expanded in y around 0 70.6%
associate-*r/70.6%
*-commutative70.6%
associate-*r/70.5%
associate-/r*70.5%
Simplified70.5%
associate-*r/76.4%
associate-*l/78.0%
clear-num78.0%
frac-times78.0%
metadata-eval78.0%
Applied egg-rr78.0%
Final simplification79.1%
(FPCore (x y z t) :precision binary64 (if (<= x -3.25e+19) x (if (<= x 2.4e+31) (* (/ y z) -0.3333333333333333) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.25e+19) {
tmp = x;
} else if (x <= 2.4e+31) {
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 <= (-3.25d+19)) then
tmp = x
else if (x <= 2.4d+31) 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 <= -3.25e+19) {
tmp = x;
} else if (x <= 2.4e+31) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.25e+19: tmp = x elif x <= 2.4e+31: tmp = (y / z) * -0.3333333333333333 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.25e+19) tmp = x; elseif (x <= 2.4e+31) 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 <= -3.25e+19) tmp = x; elseif (x <= 2.4e+31) tmp = (y / z) * -0.3333333333333333; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.25e+19], x, If[LessEqual[x, 2.4e+31], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.25 \cdot 10^{+19}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+31}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.25e19 or 2.39999999999999982e31 < x Initial program 98.3%
associate-*l*98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in x around inf 58.6%
if -3.25e19 < x < 2.39999999999999982e31Initial program 92.7%
associate-*l*92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in t around 0 53.2%
Taylor expanded in x around 0 48.2%
Final simplification53.1%
(FPCore (x y z t) :precision binary64 (if (<= x -1.6e+28) x (if (<= x 3.7e+27) (/ y (* z -3.0)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e+28) {
tmp = x;
} else if (x <= 3.7e+27) {
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.6d+28)) then
tmp = x
else if (x <= 3.7d+27) 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.6e+28) {
tmp = x;
} else if (x <= 3.7e+27) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.6e+28: tmp = x elif x <= 3.7e+27: tmp = y / (z * -3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.6e+28) tmp = x; elseif (x <= 3.7e+27) 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.6e+28) tmp = x; elseif (x <= 3.7e+27) tmp = y / (z * -3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.6e+28], x, If[LessEqual[x, 3.7e+27], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+28}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+27}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.6e28 or 3.70000000000000002e27 < x Initial program 98.3%
associate-*l*98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in x around inf 58.6%
if -1.6e28 < x < 3.70000000000000002e27Initial program 92.7%
*-un-lft-identity92.7%
times-frac92.6%
Applied egg-rr92.6%
clear-num92.6%
inv-pow92.6%
*-commutative92.6%
Applied egg-rr92.6%
unpow-192.6%
associate-*r*92.6%
Simplified92.6%
Taylor expanded in y around inf 48.2%
associate-*r/48.2%
associate-/l*48.2%
associate-/r/48.2%
Simplified48.2%
*-commutative48.2%
clear-num48.1%
un-div-inv48.2%
div-inv48.3%
metadata-eval48.3%
Applied egg-rr48.3%
Final simplification53.1%
(FPCore (x y z t) :precision binary64 (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y))))
double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 / z) * ((t / y) - 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) * ((t / y) - y))
end function
public static double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 / z) * ((t / y) - y));
}
def code(x, y, z, t): return x + ((0.3333333333333333 / z) * ((t / y) - y))
function code(x, y, z, t) return Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))) end
function tmp = code(x, y, z, t) tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)
\end{array}
Initial program 95.3%
Simplified96.7%
Final simplification96.7%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - 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 / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t): return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Initial program 95.3%
associate-*l*95.3%
*-commutative95.3%
Simplified95.3%
associate-+l-95.3%
*-commutative95.3%
associate-*l*95.3%
associate-/l/96.0%
sub-div96.8%
Applied egg-rr96.8%
Final simplification96.8%
(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.3%
associate-*l*95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in x around inf 31.8%
Final simplification31.8%
(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 2024021
(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))))