
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
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 - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
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 - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (/ (- z x) (/ t y))))
double code(double x, double y, double z, double t) {
return x + ((z - x) / (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 + ((z - x) / (t / y))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) / (t / y));
}
def code(x, y, z, t): return x + ((z - x) / (t / y))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) / Float64(t / y))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) / (t / y)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - x}{\frac{t}{y}}
\end{array}
Initial program 89.9%
Taylor expanded in z around 0 85.2%
+-commutative85.2%
*-commutative85.2%
associate-*r/86.8%
mul-1-neg86.8%
associate-/l*88.8%
distribute-lft-neg-in88.8%
distribute-rgt-in98.7%
sub-neg98.7%
Simplified98.7%
*-commutative98.7%
clear-num98.6%
un-div-inv99.2%
Applied egg-rr99.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.14e+64)
(* z (/ y t))
(if (<= z -1.25e-167)
x
(if (<= z -1.1e-296)
(/ x (/ t (- y)))
(if (<= z 2.15e-92)
x
(if (<= z 1.95e+28)
(* x (/ y (- t)))
(if (<= z 1.15e+39)
x
(if (<= z 1.35e+83)
(/ y (/ t z))
(if (<= z 2.05e+87) x (/ z (/ t y)))))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.14e+64) {
tmp = z * (y / t);
} else if (z <= -1.25e-167) {
tmp = x;
} else if (z <= -1.1e-296) {
tmp = x / (t / -y);
} else if (z <= 2.15e-92) {
tmp = x;
} else if (z <= 1.95e+28) {
tmp = x * (y / -t);
} else if (z <= 1.15e+39) {
tmp = x;
} else if (z <= 1.35e+83) {
tmp = y / (t / z);
} else if (z <= 2.05e+87) {
tmp = x;
} else {
tmp = z / (t / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.14d+64)) then
tmp = z * (y / t)
else if (z <= (-1.25d-167)) then
tmp = x
else if (z <= (-1.1d-296)) then
tmp = x / (t / -y)
else if (z <= 2.15d-92) then
tmp = x
else if (z <= 1.95d+28) then
tmp = x * (y / -t)
else if (z <= 1.15d+39) then
tmp = x
else if (z <= 1.35d+83) then
tmp = y / (t / z)
else if (z <= 2.05d+87) then
tmp = x
else
tmp = z / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.14e+64) {
tmp = z * (y / t);
} else if (z <= -1.25e-167) {
tmp = x;
} else if (z <= -1.1e-296) {
tmp = x / (t / -y);
} else if (z <= 2.15e-92) {
tmp = x;
} else if (z <= 1.95e+28) {
tmp = x * (y / -t);
} else if (z <= 1.15e+39) {
tmp = x;
} else if (z <= 1.35e+83) {
tmp = y / (t / z);
} else if (z <= 2.05e+87) {
tmp = x;
} else {
tmp = z / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.14e+64: tmp = z * (y / t) elif z <= -1.25e-167: tmp = x elif z <= -1.1e-296: tmp = x / (t / -y) elif z <= 2.15e-92: tmp = x elif z <= 1.95e+28: tmp = x * (y / -t) elif z <= 1.15e+39: tmp = x elif z <= 1.35e+83: tmp = y / (t / z) elif z <= 2.05e+87: tmp = x else: tmp = z / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.14e+64) tmp = Float64(z * Float64(y / t)); elseif (z <= -1.25e-167) tmp = x; elseif (z <= -1.1e-296) tmp = Float64(x / Float64(t / Float64(-y))); elseif (z <= 2.15e-92) tmp = x; elseif (z <= 1.95e+28) tmp = Float64(x * Float64(y / Float64(-t))); elseif (z <= 1.15e+39) tmp = x; elseif (z <= 1.35e+83) tmp = Float64(y / Float64(t / z)); elseif (z <= 2.05e+87) tmp = x; else tmp = Float64(z / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.14e+64) tmp = z * (y / t); elseif (z <= -1.25e-167) tmp = x; elseif (z <= -1.1e-296) tmp = x / (t / -y); elseif (z <= 2.15e-92) tmp = x; elseif (z <= 1.95e+28) tmp = x * (y / -t); elseif (z <= 1.15e+39) tmp = x; elseif (z <= 1.35e+83) tmp = y / (t / z); elseif (z <= 2.05e+87) tmp = x; else tmp = z / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.14e+64], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.25e-167], x, If[LessEqual[z, -1.1e-296], N[(x / N[(t / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e-92], x, If[LessEqual[z, 1.95e+28], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+39], x, If[LessEqual[z, 1.35e+83], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e+87], x, N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.14 \cdot 10^{+64}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-167}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-296}:\\
\;\;\;\;\frac{x}{\frac{t}{-y}}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-92}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+28}:\\
\;\;\;\;x \cdot \frac{y}{-t}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+83}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+87}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -1.14e64Initial program 89.2%
Taylor expanded in y around -inf 65.0%
Taylor expanded in z around inf 58.3%
associate-/l*86.8%
Simplified62.6%
clear-num86.8%
un-div-inv84.8%
Applied egg-rr60.6%
associate-/r/93.1%
Applied egg-rr68.9%
if -1.14e64 < z < -1.25000000000000005e-167 or -1.10000000000000006e-296 < z < 2.15000000000000007e-92 or 1.9499999999999999e28 < z < 1.15000000000000006e39 or 1.35000000000000003e83 < z < 2.05e87Initial program 91.0%
Taylor expanded in y around 0 60.5%
if -1.25000000000000005e-167 < z < -1.10000000000000006e-296Initial program 86.6%
Taylor expanded in y around -inf 57.4%
Taylor expanded in z around 0 51.5%
mul-1-neg51.5%
associate-/l*58.2%
distribute-rgt-neg-in58.2%
mul-1-neg58.2%
associate-*r/58.2%
mul-1-neg58.2%
Simplified58.2%
add-sqr-sqrt33.1%
sqrt-unprod23.7%
sqr-neg23.7%
sqrt-unprod0.9%
add-sqr-sqrt1.9%
clear-num1.9%
div-inv1.9%
frac-2neg1.9%
distribute-frac-neg21.9%
add-sqr-sqrt1.0%
sqrt-unprod16.2%
sqr-neg16.2%
sqrt-unprod25.0%
add-sqr-sqrt60.6%
Applied egg-rr60.6%
if 2.15000000000000007e-92 < z < 1.9499999999999999e28Initial program 95.9%
Taylor expanded in y around -inf 71.6%
Taylor expanded in z around 0 51.5%
mul-1-neg51.5%
associate-/l*51.5%
distribute-rgt-neg-in51.5%
mul-1-neg51.5%
associate-*r/51.5%
mul-1-neg51.5%
Simplified51.5%
if 1.15000000000000006e39 < z < 1.35000000000000003e83Initial program 86.7%
Taylor expanded in y around -inf 80.0%
Taylor expanded in z around inf 58.3%
associate-/l*78.4%
Simplified71.4%
clear-num78.5%
un-div-inv78.5%
Applied egg-rr71.5%
if 2.05e87 < z Initial program 88.5%
Taylor expanded in y around -inf 70.2%
Taylor expanded in z around inf 66.1%
associate-/l*82.7%
Simplified64.9%
clear-num82.7%
un-div-inv82.7%
Applied egg-rr64.8%
associate-/r/93.5%
Applied egg-rr75.3%
*-commutative75.3%
clear-num75.4%
un-div-inv75.4%
Applied egg-rr75.4%
Final simplification64.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t)))))
(if (<= z -1.65e+61)
(* z (/ y t))
(if (<= z -4e-179)
x
(if (<= z -1.15e-223)
t_1
(if (<= z 8.1e-92)
x
(if (<= z 5.8e+33) t_1 (if (<= z 1.45e+39) x (/ z (/ t y))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / -t);
double tmp;
if (z <= -1.65e+61) {
tmp = z * (y / t);
} else if (z <= -4e-179) {
tmp = x;
} else if (z <= -1.15e-223) {
tmp = t_1;
} else if (z <= 8.1e-92) {
tmp = x;
} else if (z <= 5.8e+33) {
tmp = t_1;
} else if (z <= 1.45e+39) {
tmp = x;
} else {
tmp = z / (t / 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) :: t_1
real(8) :: tmp
t_1 = x * (y / -t)
if (z <= (-1.65d+61)) then
tmp = z * (y / t)
else if (z <= (-4d-179)) then
tmp = x
else if (z <= (-1.15d-223)) then
tmp = t_1
else if (z <= 8.1d-92) then
tmp = x
else if (z <= 5.8d+33) then
tmp = t_1
else if (z <= 1.45d+39) then
tmp = x
else
tmp = z / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (y / -t);
double tmp;
if (z <= -1.65e+61) {
tmp = z * (y / t);
} else if (z <= -4e-179) {
tmp = x;
} else if (z <= -1.15e-223) {
tmp = t_1;
} else if (z <= 8.1e-92) {
tmp = x;
} else if (z <= 5.8e+33) {
tmp = t_1;
} else if (z <= 1.45e+39) {
tmp = x;
} else {
tmp = z / (t / y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / -t) tmp = 0 if z <= -1.65e+61: tmp = z * (y / t) elif z <= -4e-179: tmp = x elif z <= -1.15e-223: tmp = t_1 elif z <= 8.1e-92: tmp = x elif z <= 5.8e+33: tmp = t_1 elif z <= 1.45e+39: tmp = x else: tmp = z / (t / y) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(-t))) tmp = 0.0 if (z <= -1.65e+61) tmp = Float64(z * Float64(y / t)); elseif (z <= -4e-179) tmp = x; elseif (z <= -1.15e-223) tmp = t_1; elseif (z <= 8.1e-92) tmp = x; elseif (z <= 5.8e+33) tmp = t_1; elseif (z <= 1.45e+39) tmp = x; else tmp = Float64(z / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / -t); tmp = 0.0; if (z <= -1.65e+61) tmp = z * (y / t); elseif (z <= -4e-179) tmp = x; elseif (z <= -1.15e-223) tmp = t_1; elseif (z <= 8.1e-92) tmp = x; elseif (z <= 5.8e+33) tmp = t_1; elseif (z <= 1.45e+39) tmp = x; else tmp = z / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+61], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4e-179], x, If[LessEqual[z, -1.15e-223], t$95$1, If[LessEqual[z, 8.1e-92], x, If[LessEqual[z, 5.8e+33], t$95$1, If[LessEqual[z, 1.45e+39], x, N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{-t}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+61}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-179}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-223}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.1 \cdot 10^{-92}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -1.6499999999999999e61Initial program 89.2%
Taylor expanded in y around -inf 65.0%
Taylor expanded in z around inf 58.3%
associate-/l*86.8%
Simplified62.6%
clear-num86.8%
un-div-inv84.8%
Applied egg-rr60.6%
associate-/r/93.1%
Applied egg-rr68.9%
if -1.6499999999999999e61 < z < -4.0000000000000001e-179 or -1.15e-223 < z < 8.09999999999999951e-92 or 5.80000000000000049e33 < z < 1.45000000000000015e39Initial program 90.9%
Taylor expanded in y around 0 55.9%
if -4.0000000000000001e-179 < z < -1.15e-223 or 8.09999999999999951e-92 < z < 5.80000000000000049e33Initial program 93.8%
Taylor expanded in y around -inf 72.7%
Taylor expanded in z around 0 52.3%
mul-1-neg52.3%
associate-/l*55.3%
distribute-rgt-neg-in55.3%
mul-1-neg55.3%
associate-*r/55.3%
mul-1-neg55.3%
Simplified55.3%
if 1.45000000000000015e39 < z Initial program 86.8%
Taylor expanded in y around -inf 71.2%
Taylor expanded in z around inf 63.4%
associate-/l*82.1%
Simplified65.3%
clear-num82.1%
un-div-inv82.0%
Applied egg-rr65.3%
associate-/r/90.3%
Applied egg-rr73.3%
*-commutative73.3%
clear-num73.4%
un-div-inv73.4%
Applied egg-rr73.4%
Final simplification62.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y t)))) (t_2 (+ x (* z (/ y t)))))
(if (<= z -8.2e+40)
t_2
(if (<= z -3.6e-282)
t_1
(if (<= z -3.5e-282)
(* y (/ z t))
(if (<= z 45000000.0)
t_1
(if (<= z 7.8e+50) (/ (* (- z x) y) t) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double t_2 = x + (z * (y / t));
double tmp;
if (z <= -8.2e+40) {
tmp = t_2;
} else if (z <= -3.6e-282) {
tmp = t_1;
} else if (z <= -3.5e-282) {
tmp = y * (z / t);
} else if (z <= 45000000.0) {
tmp = t_1;
} else if (z <= 7.8e+50) {
tmp = ((z - x) * y) / t;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x * (1.0d0 - (y / t))
t_2 = x + (z * (y / t))
if (z <= (-8.2d+40)) then
tmp = t_2
else if (z <= (-3.6d-282)) then
tmp = t_1
else if (z <= (-3.5d-282)) then
tmp = y * (z / t)
else if (z <= 45000000.0d0) then
tmp = t_1
else if (z <= 7.8d+50) then
tmp = ((z - x) * y) / t
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double t_2 = x + (z * (y / t));
double tmp;
if (z <= -8.2e+40) {
tmp = t_2;
} else if (z <= -3.6e-282) {
tmp = t_1;
} else if (z <= -3.5e-282) {
tmp = y * (z / t);
} else if (z <= 45000000.0) {
tmp = t_1;
} else if (z <= 7.8e+50) {
tmp = ((z - x) * y) / t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) t_2 = x + (z * (y / t)) tmp = 0 if z <= -8.2e+40: tmp = t_2 elif z <= -3.6e-282: tmp = t_1 elif z <= -3.5e-282: tmp = y * (z / t) elif z <= 45000000.0: tmp = t_1 elif z <= 7.8e+50: tmp = ((z - x) * y) / t else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) t_2 = Float64(x + Float64(z * Float64(y / t))) tmp = 0.0 if (z <= -8.2e+40) tmp = t_2; elseif (z <= -3.6e-282) tmp = t_1; elseif (z <= -3.5e-282) tmp = Float64(y * Float64(z / t)); elseif (z <= 45000000.0) tmp = t_1; elseif (z <= 7.8e+50) tmp = Float64(Float64(Float64(z - x) * y) / t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / t)); t_2 = x + (z * (y / t)); tmp = 0.0; if (z <= -8.2e+40) tmp = t_2; elseif (z <= -3.6e-282) tmp = t_1; elseif (z <= -3.5e-282) tmp = y * (z / t); elseif (z <= 45000000.0) tmp = t_1; elseif (z <= 7.8e+50) tmp = ((z - x) * y) / t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+40], t$95$2, If[LessEqual[z, -3.6e-282], t$95$1, If[LessEqual[z, -3.5e-282], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 45000000.0], t$95$1, If[LessEqual[z, 7.8e+50], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
t_2 := x + z \cdot \frac{y}{t}\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+40}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-282}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 45000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+50}:\\
\;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -8.2000000000000003e40 or 7.79999999999999935e50 < z Initial program 86.8%
Taylor expanded in z around inf 81.6%
associate-/l*84.2%
Simplified84.2%
clear-num84.2%
un-div-inv83.4%
Applied egg-rr83.4%
associate-/r/91.8%
Applied egg-rr91.8%
if -8.2000000000000003e40 < z < -3.5999999999999998e-282 or -3.50000000000000006e-282 < z < 4.5e7Initial program 92.1%
Taylor expanded in x around inf 87.4%
mul-1-neg87.4%
unsub-neg87.4%
Simplified87.4%
if -3.5999999999999998e-282 < z < -3.50000000000000006e-282Initial program 4.0%
Taylor expanded in y around -inf 4.1%
Taylor expanded in z around inf 4.1%
associate-/l*100.0%
Simplified100.0%
if 4.5e7 < z < 7.79999999999999935e50Initial program 99.9%
Taylor expanded in y around -inf 85.5%
Final simplification89.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y t)))) (t_2 (+ x (* z (/ y t)))))
(if (<= z -6.4e+40)
t_2
(if (<= z -3.6e-282)
t_1
(if (<= z -3.5e-282)
(* y (/ z t))
(if (<= z 155.0) t_1 (if (<= z 6.9e+47) (* (- z x) (/ y t)) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double t_2 = x + (z * (y / t));
double tmp;
if (z <= -6.4e+40) {
tmp = t_2;
} else if (z <= -3.6e-282) {
tmp = t_1;
} else if (z <= -3.5e-282) {
tmp = y * (z / t);
} else if (z <= 155.0) {
tmp = t_1;
} else if (z <= 6.9e+47) {
tmp = (z - x) * (y / t);
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x * (1.0d0 - (y / t))
t_2 = x + (z * (y / t))
if (z <= (-6.4d+40)) then
tmp = t_2
else if (z <= (-3.6d-282)) then
tmp = t_1
else if (z <= (-3.5d-282)) then
tmp = y * (z / t)
else if (z <= 155.0d0) then
tmp = t_1
else if (z <= 6.9d+47) then
tmp = (z - x) * (y / t)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double t_2 = x + (z * (y / t));
double tmp;
if (z <= -6.4e+40) {
tmp = t_2;
} else if (z <= -3.6e-282) {
tmp = t_1;
} else if (z <= -3.5e-282) {
tmp = y * (z / t);
} else if (z <= 155.0) {
tmp = t_1;
} else if (z <= 6.9e+47) {
tmp = (z - x) * (y / t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) t_2 = x + (z * (y / t)) tmp = 0 if z <= -6.4e+40: tmp = t_2 elif z <= -3.6e-282: tmp = t_1 elif z <= -3.5e-282: tmp = y * (z / t) elif z <= 155.0: tmp = t_1 elif z <= 6.9e+47: tmp = (z - x) * (y / t) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) t_2 = Float64(x + Float64(z * Float64(y / t))) tmp = 0.0 if (z <= -6.4e+40) tmp = t_2; elseif (z <= -3.6e-282) tmp = t_1; elseif (z <= -3.5e-282) tmp = Float64(y * Float64(z / t)); elseif (z <= 155.0) tmp = t_1; elseif (z <= 6.9e+47) tmp = Float64(Float64(z - x) * Float64(y / t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / t)); t_2 = x + (z * (y / t)); tmp = 0.0; if (z <= -6.4e+40) tmp = t_2; elseif (z <= -3.6e-282) tmp = t_1; elseif (z <= -3.5e-282) tmp = y * (z / t); elseif (z <= 155.0) tmp = t_1; elseif (z <= 6.9e+47) tmp = (z - x) * (y / t); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e+40], t$95$2, If[LessEqual[z, -3.6e-282], t$95$1, If[LessEqual[z, -3.5e-282], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 155.0], t$95$1, If[LessEqual[z, 6.9e+47], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
t_2 := x + z \cdot \frac{y}{t}\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+40}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-282}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 155:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.9 \cdot 10^{+47}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.39999999999999961e40 or 6.9000000000000004e47 < z Initial program 86.8%
Taylor expanded in z around inf 81.6%
associate-/l*84.2%
Simplified84.2%
clear-num84.2%
un-div-inv83.4%
Applied egg-rr83.4%
associate-/r/91.8%
Applied egg-rr91.8%
if -6.39999999999999961e40 < z < -3.5999999999999998e-282 or -3.50000000000000006e-282 < z < 155Initial program 92.1%
Taylor expanded in x around inf 87.4%
mul-1-neg87.4%
unsub-neg87.4%
Simplified87.4%
if -3.5999999999999998e-282 < z < -3.50000000000000006e-282Initial program 4.0%
Taylor expanded in y around -inf 4.1%
Taylor expanded in z around inf 4.1%
associate-/l*100.0%
Simplified100.0%
if 155 < z < 6.9000000000000004e47Initial program 99.9%
Taylor expanded in y around -inf 85.5%
Taylor expanded in z around 0 85.5%
+-commutative99.9%
*-commutative99.9%
associate-*r/99.8%
mul-1-neg99.8%
associate-/l*92.1%
distribute-lft-neg-in92.1%
distribute-rgt-in99.8%
sub-neg99.8%
Simplified85.4%
Final simplification89.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- z x) (/ y t))))
(if (<= z -2.45e+69)
t_1
(if (<= z 1250.0)
(* x (- 1.0 (/ y t)))
(if (or (<= z 1e+114) (not (<= z 3.6e+114))) t_1 x)))))
double code(double x, double y, double z, double t) {
double t_1 = (z - x) * (y / t);
double tmp;
if (z <= -2.45e+69) {
tmp = t_1;
} else if (z <= 1250.0) {
tmp = x * (1.0 - (y / t));
} else if ((z <= 1e+114) || !(z <= 3.6e+114)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (z - x) * (y / t)
if (z <= (-2.45d+69)) then
tmp = t_1
else if (z <= 1250.0d0) then
tmp = x * (1.0d0 - (y / t))
else if ((z <= 1d+114) .or. (.not. (z <= 3.6d+114))) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z - x) * (y / t);
double tmp;
if (z <= -2.45e+69) {
tmp = t_1;
} else if (z <= 1250.0) {
tmp = x * (1.0 - (y / t));
} else if ((z <= 1e+114) || !(z <= 3.6e+114)) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z - x) * (y / t) tmp = 0 if z <= -2.45e+69: tmp = t_1 elif z <= 1250.0: tmp = x * (1.0 - (y / t)) elif (z <= 1e+114) or not (z <= 3.6e+114): tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z - x) * Float64(y / t)) tmp = 0.0 if (z <= -2.45e+69) tmp = t_1; elseif (z <= 1250.0) tmp = Float64(x * Float64(1.0 - Float64(y / t))); elseif ((z <= 1e+114) || !(z <= 3.6e+114)) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z - x) * (y / t); tmp = 0.0; if (z <= -2.45e+69) tmp = t_1; elseif (z <= 1250.0) tmp = x * (1.0 - (y / t)); elseif ((z <= 1e+114) || ~((z <= 3.6e+114))) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.45e+69], t$95$1, If[LessEqual[z, 1250.0], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1e+114], N[Not[LessEqual[z, 3.6e+114]], $MachinePrecision]], t$95$1, x]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1250:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{elif}\;z \leq 10^{+114} \lor \neg \left(z \leq 3.6 \cdot 10^{+114}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.45e69 or 1250 < z < 1e114 or 3.6000000000000001e114 < z Initial program 88.4%
Taylor expanded in y around -inf 70.4%
Taylor expanded in z around 0 62.4%
+-commutative80.4%
*-commutative80.4%
associate-*r/89.3%
mul-1-neg89.3%
associate-/l*86.6%
distribute-lft-neg-in86.6%
distribute-rgt-in99.6%
sub-neg99.6%
Simplified80.8%
if -2.45e69 < z < 1250Initial program 91.1%
Taylor expanded in x around inf 86.5%
mul-1-neg86.5%
unsub-neg86.5%
Simplified86.5%
if 1e114 < z < 3.6000000000000001e114Initial program 100.0%
Taylor expanded in y around 0 100.0%
Final simplification84.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y (/ z t)))))
(if (<= z -9e+73)
t_1
(if (<= z 3600.0)
(* x (- 1.0 (/ y t)))
(if (<= z 5e+108) (* (- z x) (/ y t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * (z / t));
double tmp;
if (z <= -9e+73) {
tmp = t_1;
} else if (z <= 3600.0) {
tmp = x * (1.0 - (y / t));
} else if (z <= 5e+108) {
tmp = (z - x) * (y / t);
} else {
tmp = t_1;
}
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 + (y * (z / t))
if (z <= (-9d+73)) then
tmp = t_1
else if (z <= 3600.0d0) then
tmp = x * (1.0d0 - (y / t))
else if (z <= 5d+108) then
tmp = (z - x) * (y / t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (y * (z / t));
double tmp;
if (z <= -9e+73) {
tmp = t_1;
} else if (z <= 3600.0) {
tmp = x * (1.0 - (y / t));
} else if (z <= 5e+108) {
tmp = (z - x) * (y / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * (z / t)) tmp = 0 if z <= -9e+73: tmp = t_1 elif z <= 3600.0: tmp = x * (1.0 - (y / t)) elif z <= 5e+108: tmp = (z - x) * (y / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * Float64(z / t))) tmp = 0.0 if (z <= -9e+73) tmp = t_1; elseif (z <= 3600.0) tmp = Float64(x * Float64(1.0 - Float64(y / t))); elseif (z <= 5e+108) tmp = Float64(Float64(z - x) * Float64(y / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * (z / t)); tmp = 0.0; if (z <= -9e+73) tmp = t_1; elseif (z <= 3600.0) tmp = x * (1.0 - (y / t)); elseif (z <= 5e+108) tmp = (z - x) * (y / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e+73], t$95$1, If[LessEqual[z, 3600.0], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+108], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{t}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3600:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+108}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.99999999999999969e73 or 4.99999999999999991e108 < z Initial program 88.2%
Taylor expanded in z around inf 83.8%
associate-/l*84.9%
Simplified84.9%
if -8.99999999999999969e73 < z < 3600Initial program 91.3%
Taylor expanded in x around inf 86.0%
mul-1-neg86.0%
unsub-neg86.0%
Simplified86.0%
if 3600 < z < 4.99999999999999991e108Initial program 88.6%
Taylor expanded in y around -inf 81.1%
Taylor expanded in z around 0 73.1%
+-commutative80.6%
*-commutative80.6%
associate-*r/87.8%
mul-1-neg87.8%
associate-/l*83.8%
distribute-lft-neg-in83.8%
distribute-rgt-in99.8%
sub-neg99.8%
Simplified88.3%
Final simplification85.9%
(FPCore (x y z t) :precision binary64 (if (<= y -6e+104) (* y (/ (- z x) t)) (if (<= y 1.52e+66) (+ x (* z (/ y t))) (/ (- z x) (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e+104) {
tmp = y * ((z - x) / t);
} else if (y <= 1.52e+66) {
tmp = x + (z * (y / t));
} else {
tmp = (z - x) / (t / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6d+104)) then
tmp = y * ((z - x) / t)
else if (y <= 1.52d+66) then
tmp = x + (z * (y / t))
else
tmp = (z - x) / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e+104) {
tmp = y * ((z - x) / t);
} else if (y <= 1.52e+66) {
tmp = x + (z * (y / t));
} else {
tmp = (z - x) / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6e+104: tmp = y * ((z - x) / t) elif y <= 1.52e+66: tmp = x + (z * (y / t)) else: tmp = (z - x) / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6e+104) tmp = Float64(y * Float64(Float64(z - x) / t)); elseif (y <= 1.52e+66) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(Float64(z - x) / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6e+104) tmp = y * ((z - x) / t); elseif (y <= 1.52e+66) tmp = x + (z * (y / t)); else tmp = (z - x) / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6e+104], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.52e+66], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+104}:\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{elif}\;y \leq 1.52 \cdot 10^{+66}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{z - x}{\frac{t}{y}}\\
\end{array}
\end{array}
if y < -5.99999999999999937e104Initial program 86.2%
Taylor expanded in y around -inf 80.6%
associate-/l*91.8%
*-commutative91.8%
Applied egg-rr91.8%
if -5.99999999999999937e104 < y < 1.52000000000000004e66Initial program 94.4%
Taylor expanded in z around inf 82.6%
associate-/l*78.8%
Simplified78.8%
clear-num78.8%
un-div-inv78.7%
Applied egg-rr78.7%
associate-/r/84.8%
Applied egg-rr84.8%
if 1.52000000000000004e66 < y Initial program 80.6%
Taylor expanded in y around -inf 78.9%
associate-/l*89.7%
*-commutative89.7%
Applied egg-rr89.7%
associate-/r/92.6%
Applied egg-rr92.6%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (<= z -3.5e+231) (* z (/ y t)) (if (<= z 110000000.0) (* x (- 1.0 (/ y t))) (/ z (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e+231) {
tmp = z * (y / t);
} else if (z <= 110000000.0) {
tmp = x * (1.0 - (y / t));
} else {
tmp = z / (t / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.5d+231)) then
tmp = z * (y / t)
else if (z <= 110000000.0d0) then
tmp = x * (1.0d0 - (y / t))
else
tmp = z / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e+231) {
tmp = z * (y / t);
} else if (z <= 110000000.0) {
tmp = x * (1.0 - (y / t));
} else {
tmp = z / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.5e+231: tmp = z * (y / t) elif z <= 110000000.0: tmp = x * (1.0 - (y / t)) else: tmp = z / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.5e+231) tmp = Float64(z * Float64(y / t)); elseif (z <= 110000000.0) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(z / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.5e+231) tmp = z * (y / t); elseif (z <= 110000000.0) tmp = x * (1.0 - (y / t)); else tmp = z / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.5e+231], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 110000000.0], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+231}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 110000000:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -3.4999999999999999e231Initial program 85.6%
Taylor expanded in y around -inf 78.2%
Taylor expanded in z around inf 78.2%
associate-/l*78.6%
Simplified71.2%
clear-num78.7%
un-div-inv78.7%
Applied egg-rr71.3%
associate-/r/99.8%
Applied egg-rr92.4%
if -3.4999999999999999e231 < z < 1.1e8Initial program 91.1%
Taylor expanded in x around inf 80.7%
mul-1-neg80.7%
unsub-neg80.7%
Simplified80.7%
if 1.1e8 < z Initial program 88.1%
Taylor expanded in y around -inf 72.7%
Taylor expanded in z around inf 61.7%
associate-/l*78.6%
Simplified62.1%
clear-num78.6%
un-div-inv79.5%
Applied egg-rr63.0%
associate-/r/87.4%
Applied egg-rr70.7%
*-commutative70.7%
clear-num70.8%
un-div-inv70.7%
Applied egg-rr70.7%
Final simplification78.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4e+63) (not (<= z 2.45e-39))) (* z (/ y t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4e+63) || !(z <= 2.45e-39)) {
tmp = z * (y / t);
} 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 ((z <= (-4d+63)) .or. (.not. (z <= 2.45d-39))) then
tmp = z * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4e+63) || !(z <= 2.45e-39)) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4e+63) or not (z <= 2.45e-39): tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4e+63) || !(z <= 2.45e-39)) tmp = Float64(z * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4e+63) || ~((z <= 2.45e-39))) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4e+63], N[Not[LessEqual[z, 2.45e-39]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+63} \lor \neg \left(z \leq 2.45 \cdot 10^{-39}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.00000000000000023e63 or 2.44999999999999987e-39 < z Initial program 89.0%
Taylor expanded in y around -inf 69.4%
Taylor expanded in z around inf 58.8%
associate-/l*80.9%
Simplified60.6%
clear-num80.9%
un-div-inv80.7%
Applied egg-rr60.4%
associate-/r/88.4%
Applied egg-rr68.0%
if -4.00000000000000023e63 < z < 2.44999999999999987e-39Initial program 90.8%
Taylor expanded in y around 0 51.7%
Final simplification59.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.2e+74) (not (<= z 0.07))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.2e+74) || !(z <= 0.07)) {
tmp = y * (z / t);
} 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 ((z <= (-1.2d+74)) .or. (.not. (z <= 0.07d0))) then
tmp = y * (z / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.2e+74) || !(z <= 0.07)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.2e+74) or not (z <= 0.07): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.2e+74) || !(z <= 0.07)) tmp = Float64(y * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.2e+74) || ~((z <= 0.07))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.2e+74], N[Not[LessEqual[z, 0.07]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+74} \lor \neg \left(z \leq 0.07\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.20000000000000004e74 or 0.070000000000000007 < z Initial program 88.3%
Taylor expanded in y around -inf 69.3%
Taylor expanded in z around inf 59.8%
associate-/l*81.4%
Simplified61.6%
if -1.20000000000000004e74 < z < 0.070000000000000007Initial program 91.3%
Taylor expanded in y around 0 50.8%
Final simplification55.6%
(FPCore (x y z t) :precision binary64 (if (<= z -5.2e+62) (* z (/ y t)) (if (<= z 500.0) x (/ z (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+62) {
tmp = z * (y / t);
} else if (z <= 500.0) {
tmp = x;
} else {
tmp = z / (t / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.2d+62)) then
tmp = z * (y / t)
else if (z <= 500.0d0) then
tmp = x
else
tmp = z / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+62) {
tmp = z * (y / t);
} else if (z <= 500.0) {
tmp = x;
} else {
tmp = z / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e+62: tmp = z * (y / t) elif z <= 500.0: tmp = x else: tmp = z / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e+62) tmp = Float64(z * Float64(y / t)); elseif (z <= 500.0) tmp = x; else tmp = Float64(z / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e+62) tmp = z * (y / t); elseif (z <= 500.0) tmp = x; else tmp = z / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e+62], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 500.0], x, N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+62}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 500:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -5.19999999999999968e62Initial program 89.2%
Taylor expanded in y around -inf 65.0%
Taylor expanded in z around inf 58.3%
associate-/l*86.8%
Simplified62.6%
clear-num86.8%
un-div-inv84.8%
Applied egg-rr60.6%
associate-/r/93.1%
Applied egg-rr68.9%
if -5.19999999999999968e62 < z < 500Initial program 91.1%
Taylor expanded in y around 0 51.4%
if 500 < z Initial program 88.1%
Taylor expanded in y around -inf 72.7%
Taylor expanded in z around inf 61.7%
associate-/l*78.6%
Simplified62.1%
clear-num78.6%
un-div-inv79.5%
Applied egg-rr63.0%
associate-/r/87.4%
Applied egg-rr70.7%
*-commutative70.7%
clear-num70.8%
un-div-inv70.7%
Applied egg-rr70.7%
Final simplification59.9%
(FPCore (x y z t) :precision binary64 (+ x (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / t));
}
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 + ((z - x) * (y / t))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / t));
}
def code(x, y, z, t): return x + ((z - x) * (y / t))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) * Float64(y / t))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) * (y / t)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - x\right) \cdot \frac{y}{t}
\end{array}
Initial program 89.9%
Taylor expanded in z around 0 85.2%
+-commutative85.2%
*-commutative85.2%
associate-*r/86.8%
mul-1-neg86.8%
associate-/l*88.8%
distribute-lft-neg-in88.8%
distribute-rgt-in98.7%
sub-neg98.7%
Simplified98.7%
Final simplification98.7%
(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 89.9%
Taylor expanded in y around 0 37.8%
(FPCore (x y z t) :precision binary64 (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
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 - ((x * (y / t)) + (-z * (y / t)))
end function
public static double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
def code(x, y, z, t): return x - ((x * (y / t)) + (-z * (y / t)))
function code(x, y, z, t) return Float64(x - Float64(Float64(x * Float64(y / t)) + Float64(Float64(-z) * Float64(y / t)))) end
function tmp = code(x, y, z, t) tmp = x - ((x * (y / t)) + (-z * (y / t))); end
code[x_, y_, z_, t_] := N[(x - N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)
\end{array}
herbie shell --seed 2024107
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:alt
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))