
(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 13 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) (/ 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 94.8%
*-commutative94.8%
associate-/l*97.5%
Applied egg-rr97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- y) t))) (t_2 (/ z (/ t y))))
(if (<= t -2.75e+84)
x
(if (<= t -4.7e-150)
t_2
(if (<= t -3.6e-231)
t_1
(if (<= t 4.2e-304)
t_2
(if (<= t 1.45e-272) t_1 (if (<= t 1.05e+64) t_2 x))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (-y / t);
double t_2 = z / (t / y);
double tmp;
if (t <= -2.75e+84) {
tmp = x;
} else if (t <= -4.7e-150) {
tmp = t_2;
} else if (t <= -3.6e-231) {
tmp = t_1;
} else if (t <= 4.2e-304) {
tmp = t_2;
} else if (t <= 1.45e-272) {
tmp = t_1;
} else if (t <= 1.05e+64) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x * (-y / t)
t_2 = z / (t / y)
if (t <= (-2.75d+84)) then
tmp = x
else if (t <= (-4.7d-150)) then
tmp = t_2
else if (t <= (-3.6d-231)) then
tmp = t_1
else if (t <= 4.2d-304) then
tmp = t_2
else if (t <= 1.45d-272) then
tmp = t_1
else if (t <= 1.05d+64) then
tmp = t_2
else
tmp = x
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 t_2 = z / (t / y);
double tmp;
if (t <= -2.75e+84) {
tmp = x;
} else if (t <= -4.7e-150) {
tmp = t_2;
} else if (t <= -3.6e-231) {
tmp = t_1;
} else if (t <= 4.2e-304) {
tmp = t_2;
} else if (t <= 1.45e-272) {
tmp = t_1;
} else if (t <= 1.05e+64) {
tmp = t_2;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (-y / t) t_2 = z / (t / y) tmp = 0 if t <= -2.75e+84: tmp = x elif t <= -4.7e-150: tmp = t_2 elif t <= -3.6e-231: tmp = t_1 elif t <= 4.2e-304: tmp = t_2 elif t <= 1.45e-272: tmp = t_1 elif t <= 1.05e+64: tmp = t_2 else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(-y) / t)) t_2 = Float64(z / Float64(t / y)) tmp = 0.0 if (t <= -2.75e+84) tmp = x; elseif (t <= -4.7e-150) tmp = t_2; elseif (t <= -3.6e-231) tmp = t_1; elseif (t <= 4.2e-304) tmp = t_2; elseif (t <= 1.45e-272) tmp = t_1; elseif (t <= 1.05e+64) tmp = t_2; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (-y / t); t_2 = z / (t / y); tmp = 0.0; if (t <= -2.75e+84) tmp = x; elseif (t <= -4.7e-150) tmp = t_2; elseif (t <= -3.6e-231) tmp = t_1; elseif (t <= 4.2e-304) tmp = t_2; elseif (t <= 1.45e-272) tmp = t_1; elseif (t <= 1.05e+64) tmp = t_2; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[((-y) / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.75e+84], x, If[LessEqual[t, -4.7e-150], t$95$2, If[LessEqual[t, -3.6e-231], t$95$1, If[LessEqual[t, 4.2e-304], t$95$2, If[LessEqual[t, 1.45e-272], t$95$1, If[LessEqual[t, 1.05e+64], t$95$2, x]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{-y}{t}\\
t_2 := \frac{z}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -2.75 \cdot 10^{+84}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-150}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.6 \cdot 10^{-231}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-304}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+64}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.7500000000000002e84 or 1.05e64 < t Initial program 90.7%
Taylor expanded in y around 0 66.0%
if -2.7500000000000002e84 < t < -4.6999999999999999e-150 or -3.59999999999999973e-231 < t < 4.20000000000000016e-304 or 1.44999999999999997e-272 < t < 1.05e64Initial program 97.1%
Taylor expanded in y around -inf 83.9%
*-commutative97.1%
associate-/l*97.0%
Applied egg-rr83.8%
Taylor expanded in z around inf 56.8%
*-commutative70.0%
associate-*l/67.9%
associate-/r/73.0%
Simplified59.8%
if -4.6999999999999999e-150 < t < -3.59999999999999973e-231 or 4.20000000000000016e-304 < t < 1.44999999999999997e-272Initial program 97.1%
Taylor expanded in y around -inf 85.4%
Taylor expanded in z around 0 65.6%
mul-1-neg65.6%
associate-/l*73.9%
distribute-rgt-neg-in73.9%
mul-1-neg73.9%
associate-*r/73.9%
mul-1-neg73.9%
Simplified73.9%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -9e+85)
(not (or (<= t 3.1e-52) (and (not (<= t 1.15e-28)) (<= t 1.6e+64)))))
(* x (- 1.0 (/ y t)))
(* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9e+85) || !((t <= 3.1e-52) || (!(t <= 1.15e-28) && (t <= 1.6e+64)))) {
tmp = x * (1.0 - (y / t));
} else {
tmp = (z - x) * (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 ((t <= (-9d+85)) .or. (.not. (t <= 3.1d-52) .or. (.not. (t <= 1.15d-28)) .and. (t <= 1.6d+64))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = (z - x) * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9e+85) || !((t <= 3.1e-52) || (!(t <= 1.15e-28) && (t <= 1.6e+64)))) {
tmp = x * (1.0 - (y / t));
} else {
tmp = (z - x) * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9e+85) or not ((t <= 3.1e-52) or (not (t <= 1.15e-28) and (t <= 1.6e+64))): tmp = x * (1.0 - (y / t)) else: tmp = (z - x) * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9e+85) || !((t <= 3.1e-52) || (!(t <= 1.15e-28) && (t <= 1.6e+64)))) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(Float64(z - x) * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -9e+85) || ~(((t <= 3.1e-52) || (~((t <= 1.15e-28)) && (t <= 1.6e+64))))) tmp = x * (1.0 - (y / t)); else tmp = (z - x) * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9e+85], N[Not[Or[LessEqual[t, 3.1e-52], And[N[Not[LessEqual[t, 1.15e-28]], $MachinePrecision], LessEqual[t, 1.6e+64]]]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+85} \lor \neg \left(t \leq 3.1 \cdot 10^{-52} \lor \neg \left(t \leq 1.15 \cdot 10^{-28}\right) \land t \leq 1.6 \cdot 10^{+64}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -9.00000000000000013e85 or 3.0999999999999999e-52 < t < 1.14999999999999993e-28 or 1.60000000000000009e64 < t Initial program 91.3%
Taylor expanded in x around inf 78.4%
mul-1-neg78.4%
unsub-neg78.4%
Simplified78.4%
if -9.00000000000000013e85 < t < 3.0999999999999999e-52 or 1.14999999999999993e-28 < t < 1.60000000000000009e64Initial program 97.0%
Taylor expanded in y around -inf 86.1%
*-commutative97.0%
associate-/l*96.9%
Applied egg-rr86.1%
Final simplification83.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y t)))))
(if (<= t -2.9e+83)
t_1
(if (<= t 7e-48)
(* (- z x) (/ y t))
(if (or (<= t 1.1e-28) (not (<= t 7.5e+64)))
t_1
(* y (/ (- z x) t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double tmp;
if (t <= -2.9e+83) {
tmp = t_1;
} else if (t <= 7e-48) {
tmp = (z - x) * (y / t);
} else if ((t <= 1.1e-28) || !(t <= 7.5e+64)) {
tmp = t_1;
} else {
tmp = y * ((z - x) / 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) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (y / t))
if (t <= (-2.9d+83)) then
tmp = t_1
else if (t <= 7d-48) then
tmp = (z - x) * (y / t)
else if ((t <= 1.1d-28) .or. (.not. (t <= 7.5d+64))) then
tmp = t_1
else
tmp = y * ((z - x) / t)
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 tmp;
if (t <= -2.9e+83) {
tmp = t_1;
} else if (t <= 7e-48) {
tmp = (z - x) * (y / t);
} else if ((t <= 1.1e-28) || !(t <= 7.5e+64)) {
tmp = t_1;
} else {
tmp = y * ((z - x) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) tmp = 0 if t <= -2.9e+83: tmp = t_1 elif t <= 7e-48: tmp = (z - x) * (y / t) elif (t <= 1.1e-28) or not (t <= 7.5e+64): tmp = t_1 else: tmp = y * ((z - x) / t) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (t <= -2.9e+83) tmp = t_1; elseif (t <= 7e-48) tmp = Float64(Float64(z - x) * Float64(y / t)); elseif ((t <= 1.1e-28) || !(t <= 7.5e+64)) tmp = t_1; else tmp = Float64(y * Float64(Float64(z - x) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / t)); tmp = 0.0; if (t <= -2.9e+83) tmp = t_1; elseif (t <= 7e-48) tmp = (z - x) * (y / t); elseif ((t <= 1.1e-28) || ~((t <= 7.5e+64))) tmp = t_1; else tmp = y * ((z - x) / t); 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]}, If[LessEqual[t, -2.9e+83], t$95$1, If[LessEqual[t, 7e-48], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1.1e-28], N[Not[LessEqual[t, 7.5e+64]], $MachinePrecision]], t$95$1, N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-48}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-28} \lor \neg \left(t \leq 7.5 \cdot 10^{+64}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\end{array}
\end{array}
if t < -2.89999999999999999e83 or 6.99999999999999982e-48 < t < 1.09999999999999998e-28 or 7.5000000000000005e64 < t Initial program 91.3%
Taylor expanded in x around inf 78.4%
mul-1-neg78.4%
unsub-neg78.4%
Simplified78.4%
if -2.89999999999999999e83 < t < 6.99999999999999982e-48Initial program 96.7%
Taylor expanded in y around -inf 85.4%
*-commutative96.7%
associate-/l*96.6%
Applied egg-rr85.3%
if 1.09999999999999998e-28 < t < 7.5000000000000005e64Initial program 99.9%
Taylor expanded in y around -inf 93.5%
associate-/l*93.3%
*-commutative93.3%
Applied egg-rr93.3%
Final simplification83.2%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.35e+83)
(+ x (* y (/ z t)))
(if (<= t 2.3e-48)
(/ (- z x) (/ t y))
(if (<= t 1.1e-28)
(- x (/ (* x y) t))
(if (<= t 3.5e+50) (/ (* (- z x) y) t) (+ x (/ (* z y) t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.35e+83) {
tmp = x + (y * (z / t));
} else if (t <= 2.3e-48) {
tmp = (z - x) / (t / y);
} else if (t <= 1.1e-28) {
tmp = x - ((x * y) / t);
} else if (t <= 3.5e+50) {
tmp = ((z - x) * y) / t;
} else {
tmp = x + ((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 (t <= (-2.35d+83)) then
tmp = x + (y * (z / t))
else if (t <= 2.3d-48) then
tmp = (z - x) / (t / y)
else if (t <= 1.1d-28) then
tmp = x - ((x * y) / t)
else if (t <= 3.5d+50) then
tmp = ((z - x) * y) / t
else
tmp = x + ((z * y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.35e+83) {
tmp = x + (y * (z / t));
} else if (t <= 2.3e-48) {
tmp = (z - x) / (t / y);
} else if (t <= 1.1e-28) {
tmp = x - ((x * y) / t);
} else if (t <= 3.5e+50) {
tmp = ((z - x) * y) / t;
} else {
tmp = x + ((z * y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.35e+83: tmp = x + (y * (z / t)) elif t <= 2.3e-48: tmp = (z - x) / (t / y) elif t <= 1.1e-28: tmp = x - ((x * y) / t) elif t <= 3.5e+50: tmp = ((z - x) * y) / t else: tmp = x + ((z * y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.35e+83) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (t <= 2.3e-48) tmp = Float64(Float64(z - x) / Float64(t / y)); elseif (t <= 1.1e-28) tmp = Float64(x - Float64(Float64(x * y) / t)); elseif (t <= 3.5e+50) tmp = Float64(Float64(Float64(z - x) * y) / t); else tmp = Float64(x + Float64(Float64(z * y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.35e+83) tmp = x + (y * (z / t)); elseif (t <= 2.3e-48) tmp = (z - x) / (t / y); elseif (t <= 1.1e-28) tmp = x - ((x * y) / t); elseif (t <= 3.5e+50) tmp = ((z - x) * y) / t; else tmp = x + ((z * y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.35e+83], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e-48], N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.1e-28], N[(x - N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+50], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{+83}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-48}:\\
\;\;\;\;\frac{z - x}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-28}:\\
\;\;\;\;x - \frac{x \cdot y}{t}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+50}:\\
\;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{t}\\
\end{array}
\end{array}
if t < -2.3499999999999999e83Initial program 84.6%
Taylor expanded in z around inf 76.8%
associate-/l*87.6%
Simplified87.6%
if -2.3499999999999999e83 < t < 2.3000000000000001e-48Initial program 96.7%
Taylor expanded in y around -inf 85.4%
*-commutative96.7%
associate-/l*96.6%
Applied egg-rr85.3%
clear-num85.3%
un-div-inv85.9%
Applied egg-rr85.9%
if 2.3000000000000001e-48 < t < 1.09999999999999998e-28Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-*r/100.0%
mul-1-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
Simplified100.0%
if 1.09999999999999998e-28 < t < 3.50000000000000006e50Initial program 99.9%
Taylor expanded in y around -inf 92.5%
if 3.50000000000000006e50 < t Initial program 96.1%
Taylor expanded in z around inf 89.7%
Final simplification87.6%
(FPCore (x y z t)
:precision binary64
(if (<= t -5.2e+83)
(+ x (* y (/ z t)))
(if (<= t 3.2e-52)
(/ (- z x) (/ t y))
(if (<= t 1.15e-28)
(* x (- 1.0 (/ y t)))
(if (<= t 2.6e+47) (/ (* (- z x) y) t) (+ x (/ (* z y) t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.2e+83) {
tmp = x + (y * (z / t));
} else if (t <= 3.2e-52) {
tmp = (z - x) / (t / y);
} else if (t <= 1.15e-28) {
tmp = x * (1.0 - (y / t));
} else if (t <= 2.6e+47) {
tmp = ((z - x) * y) / t;
} else {
tmp = x + ((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 (t <= (-5.2d+83)) then
tmp = x + (y * (z / t))
else if (t <= 3.2d-52) then
tmp = (z - x) / (t / y)
else if (t <= 1.15d-28) then
tmp = x * (1.0d0 - (y / t))
else if (t <= 2.6d+47) then
tmp = ((z - x) * y) / t
else
tmp = x + ((z * y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.2e+83) {
tmp = x + (y * (z / t));
} else if (t <= 3.2e-52) {
tmp = (z - x) / (t / y);
} else if (t <= 1.15e-28) {
tmp = x * (1.0 - (y / t));
} else if (t <= 2.6e+47) {
tmp = ((z - x) * y) / t;
} else {
tmp = x + ((z * y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.2e+83: tmp = x + (y * (z / t)) elif t <= 3.2e-52: tmp = (z - x) / (t / y) elif t <= 1.15e-28: tmp = x * (1.0 - (y / t)) elif t <= 2.6e+47: tmp = ((z - x) * y) / t else: tmp = x + ((z * y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.2e+83) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (t <= 3.2e-52) tmp = Float64(Float64(z - x) / Float64(t / y)); elseif (t <= 1.15e-28) tmp = Float64(x * Float64(1.0 - Float64(y / t))); elseif (t <= 2.6e+47) tmp = Float64(Float64(Float64(z - x) * y) / t); else tmp = Float64(x + Float64(Float64(z * y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.2e+83) tmp = x + (y * (z / t)); elseif (t <= 3.2e-52) tmp = (z - x) / (t / y); elseif (t <= 1.15e-28) tmp = x * (1.0 - (y / t)); elseif (t <= 2.6e+47) tmp = ((z - x) * y) / t; else tmp = x + ((z * y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.2e+83], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-52], N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-28], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+47], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+83}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-52}:\\
\;\;\;\;\frac{z - x}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+47}:\\
\;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{t}\\
\end{array}
\end{array}
if t < -5.2000000000000002e83Initial program 84.6%
Taylor expanded in z around inf 76.8%
associate-/l*87.6%
Simplified87.6%
if -5.2000000000000002e83 < t < 3.2000000000000001e-52Initial program 96.7%
Taylor expanded in y around -inf 85.4%
*-commutative96.7%
associate-/l*96.6%
Applied egg-rr85.3%
clear-num85.3%
un-div-inv85.9%
Applied egg-rr85.9%
if 3.2000000000000001e-52 < t < 1.14999999999999993e-28Initial program 100.0%
Taylor expanded in x around inf 99.7%
mul-1-neg99.7%
unsub-neg99.7%
Simplified99.7%
if 1.14999999999999993e-28 < t < 2.60000000000000003e47Initial program 99.9%
Taylor expanded in y around -inf 92.5%
if 2.60000000000000003e47 < t Initial program 96.1%
Taylor expanded in z around inf 89.7%
Final simplification87.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* (- z x) y) t)))
(if (<= t -1.9e+82)
(+ x (* y (/ z t)))
(if (<= t 5.5e-49)
t_1
(if (<= t 1.15e-28)
(* x (- 1.0 (/ y t)))
(if (<= t 1.72e+47) t_1 (+ x (/ (* z y) t))))))))
double code(double x, double y, double z, double t) {
double t_1 = ((z - x) * y) / t;
double tmp;
if (t <= -1.9e+82) {
tmp = x + (y * (z / t));
} else if (t <= 5.5e-49) {
tmp = t_1;
} else if (t <= 1.15e-28) {
tmp = x * (1.0 - (y / t));
} else if (t <= 1.72e+47) {
tmp = t_1;
} else {
tmp = x + ((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) :: t_1
real(8) :: tmp
t_1 = ((z - x) * y) / t
if (t <= (-1.9d+82)) then
tmp = x + (y * (z / t))
else if (t <= 5.5d-49) then
tmp = t_1
else if (t <= 1.15d-28) then
tmp = x * (1.0d0 - (y / t))
else if (t <= 1.72d+47) then
tmp = t_1
else
tmp = x + ((z * y) / t)
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 (t <= -1.9e+82) {
tmp = x + (y * (z / t));
} else if (t <= 5.5e-49) {
tmp = t_1;
} else if (t <= 1.15e-28) {
tmp = x * (1.0 - (y / t));
} else if (t <= 1.72e+47) {
tmp = t_1;
} else {
tmp = x + ((z * y) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = ((z - x) * y) / t tmp = 0 if t <= -1.9e+82: tmp = x + (y * (z / t)) elif t <= 5.5e-49: tmp = t_1 elif t <= 1.15e-28: tmp = x * (1.0 - (y / t)) elif t <= 1.72e+47: tmp = t_1 else: tmp = x + ((z * y) / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(z - x) * y) / t) tmp = 0.0 if (t <= -1.9e+82) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (t <= 5.5e-49) tmp = t_1; elseif (t <= 1.15e-28) tmp = Float64(x * Float64(1.0 - Float64(y / t))); elseif (t <= 1.72e+47) tmp = t_1; else tmp = Float64(x + Float64(Float64(z * y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((z - x) * y) / t; tmp = 0.0; if (t <= -1.9e+82) tmp = x + (y * (z / t)); elseif (t <= 5.5e-49) tmp = t_1; elseif (t <= 1.15e-28) tmp = x * (1.0 - (y / t)); elseif (t <= 1.72e+47) tmp = t_1; else tmp = x + ((z * y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -1.9e+82], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-49], t$95$1, If[LessEqual[t, 1.15e-28], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.72e+47], t$95$1, N[(x + N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{+82}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{elif}\;t \leq 1.72 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{t}\\
\end{array}
\end{array}
if t < -1.90000000000000017e82Initial program 85.3%
Taylor expanded in z around inf 77.8%
associate-/l*88.2%
Simplified88.2%
if -1.90000000000000017e82 < t < 5.50000000000000031e-49 or 1.14999999999999993e-28 < t < 1.72000000000000002e47Initial program 96.9%
Taylor expanded in y around -inf 85.8%
if 5.50000000000000031e-49 < t < 1.14999999999999993e-28Initial program 100.0%
Taylor expanded in x around inf 99.7%
mul-1-neg99.7%
unsub-neg99.7%
Simplified99.7%
if 1.72000000000000002e47 < t Initial program 96.1%
Taylor expanded in z around inf 89.7%
Final simplification87.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y t)))))
(if (<= x -4.2e-33)
t_1
(if (<= x 1.1e-202)
(+ x (* y (/ z t)))
(if (<= x 1.7e-107)
(* (- z x) (/ y t))
(if (<= x 2.4e-50) (+ x (/ z (/ t y))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double tmp;
if (x <= -4.2e-33) {
tmp = t_1;
} else if (x <= 1.1e-202) {
tmp = x + (y * (z / t));
} else if (x <= 1.7e-107) {
tmp = (z - x) * (y / t);
} else if (x <= 2.4e-50) {
tmp = x + (z / (t / y));
} 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 * (1.0d0 - (y / t))
if (x <= (-4.2d-33)) then
tmp = t_1
else if (x <= 1.1d-202) then
tmp = x + (y * (z / t))
else if (x <= 1.7d-107) then
tmp = (z - x) * (y / t)
else if (x <= 2.4d-50) then
tmp = x + (z / (t / y))
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 * (1.0 - (y / t));
double tmp;
if (x <= -4.2e-33) {
tmp = t_1;
} else if (x <= 1.1e-202) {
tmp = x + (y * (z / t));
} else if (x <= 1.7e-107) {
tmp = (z - x) * (y / t);
} else if (x <= 2.4e-50) {
tmp = x + (z / (t / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) tmp = 0 if x <= -4.2e-33: tmp = t_1 elif x <= 1.1e-202: tmp = x + (y * (z / t)) elif x <= 1.7e-107: tmp = (z - x) * (y / t) elif x <= 2.4e-50: tmp = x + (z / (t / y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (x <= -4.2e-33) tmp = t_1; elseif (x <= 1.1e-202) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (x <= 1.7e-107) tmp = Float64(Float64(z - x) * Float64(y / t)); elseif (x <= 2.4e-50) tmp = Float64(x + Float64(z / Float64(t / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / t)); tmp = 0.0; if (x <= -4.2e-33) tmp = t_1; elseif (x <= 1.1e-202) tmp = x + (y * (z / t)); elseif (x <= 1.7e-107) tmp = (z - x) * (y / t); elseif (x <= 2.4e-50) tmp = x + (z / (t / y)); else tmp = t_1; 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]}, If[LessEqual[x, -4.2e-33], t$95$1, If[LessEqual[x, 1.1e-202], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7e-107], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.4e-50], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-202}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-107}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-50}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.2e-33 or 2.40000000000000002e-50 < x Initial program 94.5%
Taylor expanded in x around inf 83.3%
mul-1-neg83.3%
unsub-neg83.3%
Simplified83.3%
if -4.2e-33 < x < 1.10000000000000004e-202Initial program 96.2%
Taylor expanded in z around inf 89.4%
associate-/l*89.8%
Simplified89.8%
if 1.10000000000000004e-202 < x < 1.69999999999999997e-107Initial program 90.7%
Taylor expanded in y around -inf 79.6%
*-commutative90.7%
associate-/l*99.7%
Applied egg-rr88.6%
if 1.69999999999999997e-107 < x < 2.40000000000000002e-50Initial program 100.0%
*-commutative100.0%
associate-/l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 100.0%
*-commutative100.0%
associate-*l/99.5%
associate-/r/100.0%
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y (/ z t)))) (t_2 (* x (- 1.0 (/ y t)))))
(if (<= x -4.2e-33)
t_2
(if (<= x 1.1e-202)
t_1
(if (<= x 1.05e-98)
(* (- z x) (/ y t))
(if (<= x 2.55e-50) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * (z / t));
double t_2 = x * (1.0 - (y / t));
double tmp;
if (x <= -4.2e-33) {
tmp = t_2;
} else if (x <= 1.1e-202) {
tmp = t_1;
} else if (x <= 1.05e-98) {
tmp = (z - x) * (y / t);
} else if (x <= 2.55e-50) {
tmp = t_1;
} 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 + (y * (z / t))
t_2 = x * (1.0d0 - (y / t))
if (x <= (-4.2d-33)) then
tmp = t_2
else if (x <= 1.1d-202) then
tmp = t_1
else if (x <= 1.05d-98) then
tmp = (z - x) * (y / t)
else if (x <= 2.55d-50) then
tmp = t_1
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 + (y * (z / t));
double t_2 = x * (1.0 - (y / t));
double tmp;
if (x <= -4.2e-33) {
tmp = t_2;
} else if (x <= 1.1e-202) {
tmp = t_1;
} else if (x <= 1.05e-98) {
tmp = (z - x) * (y / t);
} else if (x <= 2.55e-50) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * (z / t)) t_2 = x * (1.0 - (y / t)) tmp = 0 if x <= -4.2e-33: tmp = t_2 elif x <= 1.1e-202: tmp = t_1 elif x <= 1.05e-98: tmp = (z - x) * (y / t) elif x <= 2.55e-50: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * Float64(z / t))) t_2 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (x <= -4.2e-33) tmp = t_2; elseif (x <= 1.1e-202) tmp = t_1; elseif (x <= 1.05e-98) tmp = Float64(Float64(z - x) * Float64(y / t)); elseif (x <= 2.55e-50) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * (z / t)); t_2 = x * (1.0 - (y / t)); tmp = 0.0; if (x <= -4.2e-33) tmp = t_2; elseif (x <= 1.1e-202) tmp = t_1; elseif (x <= 1.05e-98) tmp = (z - x) * (y / t); elseif (x <= 2.55e-50) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.2e-33], t$95$2, If[LessEqual[x, 1.1e-202], t$95$1, If[LessEqual[x, 1.05e-98], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.55e-50], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{t}\\
t_2 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-202}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-98}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -4.2e-33 or 2.55000000000000023e-50 < x Initial program 94.5%
Taylor expanded in x around inf 83.3%
mul-1-neg83.3%
unsub-neg83.3%
Simplified83.3%
if -4.2e-33 < x < 1.10000000000000004e-202 or 1.04999999999999996e-98 < x < 2.55000000000000023e-50Initial program 96.4%
Taylor expanded in z around inf 89.9%
associate-/l*90.4%
Simplified90.4%
if 1.10000000000000004e-202 < x < 1.04999999999999996e-98Initial program 91.1%
Taylor expanded in y around -inf 80.4%
*-commutative91.1%
associate-/l*99.7%
Applied egg-rr89.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.8e-226) (not (<= x 2.25e-144))) (* x (- 1.0 (/ y t))) (* y (/ z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.8e-226) || !(x <= 2.25e-144)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = 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 ((x <= (-4.8d-226)) .or. (.not. (x <= 2.25d-144))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = y * (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.8e-226) || !(x <= 2.25e-144)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.8e-226) or not (x <= 2.25e-144): tmp = x * (1.0 - (y / t)) else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.8e-226) || !(x <= 2.25e-144)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4.8e-226) || ~((x <= 2.25e-144))) tmp = x * (1.0 - (y / t)); else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.8e-226], N[Not[LessEqual[x, 2.25e-144]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-226} \lor \neg \left(x \leq 2.25 \cdot 10^{-144}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -4.7999999999999999e-226 or 2.2499999999999999e-144 < x Initial program 95.9%
Taylor expanded in x around inf 76.8%
mul-1-neg76.8%
unsub-neg76.8%
Simplified76.8%
if -4.7999999999999999e-226 < x < 2.2499999999999999e-144Initial program 92.1%
Taylor expanded in y around -inf 80.8%
Taylor expanded in z around inf 75.7%
associate-/l*89.4%
Simplified78.1%
Final simplification77.2%
(FPCore (x y z t) :precision binary64 (if (<= t -3.5e+84) x (if (<= t 5e+63) (/ z (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.5e+84) {
tmp = x;
} else if (t <= 5e+63) {
tmp = z / (t / y);
} 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 (t <= (-3.5d+84)) then
tmp = x
else if (t <= 5d+63) then
tmp = z / (t / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.5e+84) {
tmp = x;
} else if (t <= 5e+63) {
tmp = z / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.5e+84: tmp = x elif t <= 5e+63: tmp = z / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.5e+84) tmp = x; elseif (t <= 5e+63) tmp = Float64(z / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.5e+84) tmp = x; elseif (t <= 5e+63) tmp = z / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.5e+84], x, If[LessEqual[t, 5e+63], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+84}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+63}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -3.4999999999999999e84 or 5.00000000000000011e63 < t Initial program 90.7%
Taylor expanded in y around 0 66.0%
if -3.4999999999999999e84 < t < 5.00000000000000011e63Initial program 97.1%
Taylor expanded in y around -inf 84.2%
*-commutative97.1%
associate-/l*97.0%
Applied egg-rr84.1%
Taylor expanded in z around inf 51.4%
*-commutative63.7%
associate-*l/61.4%
associate-/r/65.5%
Simplified53.3%
(FPCore (x y z t) :precision binary64 (if (<= t -9.2e+84) x (if (<= t 4e+61) (* y (/ z t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9.2e+84) {
tmp = x;
} else if (t <= 4e+61) {
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 (t <= (-9.2d+84)) then
tmp = x
else if (t <= 4d+61) 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 (t <= -9.2e+84) {
tmp = x;
} else if (t <= 4e+61) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -9.2e+84: tmp = x elif t <= 4e+61: tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -9.2e+84) tmp = x; elseif (t <= 4e+61) 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 (t <= -9.2e+84) tmp = x; elseif (t <= 4e+61) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -9.2e+84], x, If[LessEqual[t, 4e+61], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+84}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+61}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -9.1999999999999996e84 or 3.9999999999999998e61 < t Initial program 90.7%
Taylor expanded in y around 0 66.0%
if -9.1999999999999996e84 < t < 3.9999999999999998e61Initial program 97.1%
Taylor expanded in y around -inf 84.2%
Taylor expanded in z around inf 51.4%
associate-/l*61.4%
Simplified49.2%
(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 94.8%
Taylor expanded in y around 0 33.2%
(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 2024091
(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)))