
(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 16 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
(let* ((t_1 (+ x (/ (* y (- z x)) t))))
(if (<= t_1 (- INFINITY))
(+ x (* (- z x) (/ y t)))
(if (<= t_1 5e+278) t_1 (+ x (* y (/ (- z x) t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y * (z - x)) / t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + ((z - x) * (y / t));
} else if (t_1 <= 5e+278) {
tmp = t_1;
} else {
tmp = x + (y * ((z - x) / t));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + ((y * (z - x)) / t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((z - x) * (y / t));
} else if (t_1 <= 5e+278) {
tmp = t_1;
} else {
tmp = x + (y * ((z - x) / t));
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y * (z - x)) / t) tmp = 0 if t_1 <= -math.inf: tmp = x + ((z - x) * (y / t)) elif t_1 <= 5e+278: tmp = t_1 else: tmp = x + (y * ((z - x) / t)) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y * Float64(z - x)) / t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(z - x) * Float64(y / t))); elseif (t_1 <= 5e+278) tmp = t_1; else tmp = Float64(x + Float64(y * Float64(Float64(z - x) / t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y * (z - x)) / t); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((z - x) * (y / t)); elseif (t_1 <= 5e+278) tmp = t_1; else tmp = x + (y * ((z - x) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+278], t$95$1, N[(x + N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0Initial program 74.8%
Taylor expanded in z around 0 54.2%
+-commutative54.2%
*-commutative54.2%
associate-*r/57.3%
mul-1-neg57.3%
associate-/l*76.6%
distribute-lft-neg-in76.6%
distribute-rgt-in99.9%
sub-neg99.9%
Simplified99.9%
if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 5.00000000000000029e278Initial program 99.3%
if 5.00000000000000029e278 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 77.4%
+-commutative77.4%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
fma-undefine100.0%
Applied egg-rr100.0%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ (* y (- z x)) t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+303)))
(+ x (* (- z x) (/ y t)))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y * (z - x)) / t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+303)) {
tmp = x + ((z - x) * (y / t));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + ((y * (z - x)) / t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+303)) {
tmp = x + ((z - x) * (y / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y * (z - x)) / t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+303): tmp = x + ((z - x) * (y / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y * Float64(z - x)) / t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+303)) tmp = Float64(x + 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 - x)) / t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+303))) tmp = x + ((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[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+303]], $MachinePrecision]], N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+303}\right):\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0 or 4.9999999999999997e303 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 74.7%
Taylor expanded in z around 0 57.5%
+-commutative57.5%
*-commutative57.5%
associate-*r/64.0%
mul-1-neg64.0%
associate-/l*74.6%
distribute-lft-neg-in74.6%
distribute-rgt-in99.9%
sub-neg99.9%
Simplified99.9%
if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 4.9999999999999997e303Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ (* y (- z x)) t))))
(if (<= t_1 (- INFINITY))
(+ x (* (- z x) (/ y t)))
(if (<= t_1 5e+303) t_1 (+ x (/ (- z x) (/ t y)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y * (z - x)) / t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + ((z - x) * (y / t));
} else if (t_1 <= 5e+303) {
tmp = t_1;
} else {
tmp = x + ((z - x) / (t / y));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + ((y * (z - x)) / t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((z - x) * (y / t));
} else if (t_1 <= 5e+303) {
tmp = t_1;
} else {
tmp = x + ((z - x) / (t / y));
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y * (z - x)) / t) tmp = 0 if t_1 <= -math.inf: tmp = x + ((z - x) * (y / t)) elif t_1 <= 5e+303: tmp = t_1 else: tmp = x + ((z - x) / (t / y)) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y * Float64(z - x)) / t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(z - x) * Float64(y / t))); elseif (t_1 <= 5e+303) tmp = t_1; else tmp = Float64(x + Float64(Float64(z - x) / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y * (z - x)) / t); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((z - x) * (y / t)); elseif (t_1 <= 5e+303) tmp = t_1; else tmp = x + ((z - x) / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+303], t$95$1, N[(x + N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - x}{\frac{t}{y}}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0Initial program 74.8%
Taylor expanded in z around 0 54.2%
+-commutative54.2%
*-commutative54.2%
associate-*r/57.3%
mul-1-neg57.3%
associate-/l*76.6%
distribute-lft-neg-in76.6%
distribute-rgt-in99.9%
sub-neg99.9%
Simplified99.9%
if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 4.9999999999999997e303Initial program 99.4%
if 4.9999999999999997e303 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 74.6%
Taylor expanded in z around 0 60.0%
+-commutative60.0%
*-commutative60.0%
associate-*r/69.0%
mul-1-neg69.0%
associate-/l*73.1%
distribute-lft-neg-in73.1%
distribute-rgt-in99.9%
sub-neg99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -6.2e+140)
(not
(or (<= x -3.6e+31) (and (not (<= x -1.25e+18)) (<= x 1.95e+51)))))
(* x (- 1.0 (/ y t)))
(+ x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.2e+140) || !((x <= -3.6e+31) || (!(x <= -1.25e+18) && (x <= 1.95e+51)))) {
tmp = x * (1.0 - (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 ((x <= (-6.2d+140)) .or. (.not. (x <= (-3.6d+31)) .or. (.not. (x <= (-1.25d+18))) .and. (x <= 1.95d+51))) then
tmp = x * (1.0d0 - (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 ((x <= -6.2e+140) || !((x <= -3.6e+31) || (!(x <= -1.25e+18) && (x <= 1.95e+51)))) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6.2e+140) or not ((x <= -3.6e+31) or (not (x <= -1.25e+18) and (x <= 1.95e+51))): tmp = x * (1.0 - (y / t)) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6.2e+140) || !((x <= -3.6e+31) || (!(x <= -1.25e+18) && (x <= 1.95e+51)))) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -6.2e+140) || ~(((x <= -3.6e+31) || (~((x <= -1.25e+18)) && (x <= 1.95e+51))))) tmp = x * (1.0 - (y / t)); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6.2e+140], N[Not[Or[LessEqual[x, -3.6e+31], And[N[Not[LessEqual[x, -1.25e+18]], $MachinePrecision], LessEqual[x, 1.95e+51]]]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+140} \lor \neg \left(x \leq -3.6 \cdot 10^{+31} \lor \neg \left(x \leq -1.25 \cdot 10^{+18}\right) \land x \leq 1.95 \cdot 10^{+51}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if x < -6.2000000000000001e140 or -3.59999999999999996e31 < x < -1.25e18 or 1.94999999999999992e51 < x Initial program 87.4%
Taylor expanded in x around inf 92.4%
mul-1-neg92.4%
unsub-neg92.4%
Simplified92.4%
if -6.2000000000000001e140 < x < -3.59999999999999996e31 or -1.25e18 < x < 1.94999999999999992e51Initial program 95.3%
Taylor expanded in z around inf 87.4%
associate-/l*49.3%
Simplified86.8%
clear-num48.7%
un-div-inv50.4%
Applied egg-rr87.8%
associate-/r/52.5%
Applied egg-rr90.2%
Final simplification91.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.8e+235)
(* y (/ z t))
(if (or (<= z -2.35e+223) (and (not (<= z -9.5e+78)) (<= z 6e-26)))
(* x (- 1.0 (/ y t)))
(* (- z x) (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.8e+235) {
tmp = y * (z / t);
} else if ((z <= -2.35e+223) || (!(z <= -9.5e+78) && (z <= 6e-26))) {
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 (z <= (-4.8d+235)) then
tmp = y * (z / t)
else if ((z <= (-2.35d+223)) .or. (.not. (z <= (-9.5d+78))) .and. (z <= 6d-26)) 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 (z <= -4.8e+235) {
tmp = y * (z / t);
} else if ((z <= -2.35e+223) || (!(z <= -9.5e+78) && (z <= 6e-26))) {
tmp = x * (1.0 - (y / t));
} else {
tmp = (z - x) * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.8e+235: tmp = y * (z / t) elif (z <= -2.35e+223) or (not (z <= -9.5e+78) and (z <= 6e-26)): tmp = x * (1.0 - (y / t)) else: tmp = (z - x) * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.8e+235) tmp = Float64(y * Float64(z / t)); elseif ((z <= -2.35e+223) || (!(z <= -9.5e+78) && (z <= 6e-26))) 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 (z <= -4.8e+235) tmp = y * (z / t); elseif ((z <= -2.35e+223) || (~((z <= -9.5e+78)) && (z <= 6e-26))) tmp = x * (1.0 - (y / t)); else tmp = (z - x) * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.8e+235], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.35e+223], And[N[Not[LessEqual[z, -9.5e+78]], $MachinePrecision], LessEqual[z, 6e-26]]], 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}\;z \leq -4.8 \cdot 10^{+235}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{+223} \lor \neg \left(z \leq -9.5 \cdot 10^{+78}\right) \land z \leq 6 \cdot 10^{-26}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -4.7999999999999998e235Initial program 87.3%
Taylor expanded in y around -inf 61.6%
Taylor expanded in z around inf 54.9%
associate-/l*67.6%
Simplified67.6%
if -4.7999999999999998e235 < z < -2.35000000000000021e223 or -9.5000000000000006e78 < z < 6.00000000000000023e-26Initial program 93.2%
Taylor expanded in x around inf 82.6%
mul-1-neg82.6%
unsub-neg82.6%
Simplified82.6%
if -2.35000000000000021e223 < z < -9.5000000000000006e78 or 6.00000000000000023e-26 < z Initial program 92.3%
Taylor expanded in y around -inf 70.9%
Taylor expanded in z around 0 64.6%
+-commutative86.0%
*-commutative86.0%
associate-*r/91.7%
mul-1-neg91.7%
associate-/l*89.5%
distribute-lft-neg-in89.5%
distribute-rgt-in99.7%
sub-neg99.7%
Simplified78.3%
Final simplification80.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y t)))))
(if (<= z -1.12e+234)
(* y (/ z t))
(if (<= z -2.45e+177)
t_1
(if (<= z -2.3e+96)
(/ (* y z) t)
(if (<= z 1.32e+107) t_1 (* z (/ y t))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double tmp;
if (z <= -1.12e+234) {
tmp = y * (z / t);
} else if (z <= -2.45e+177) {
tmp = t_1;
} else if (z <= -2.3e+96) {
tmp = (y * z) / t;
} else if (z <= 1.32e+107) {
tmp = t_1;
} else {
tmp = 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 = x * (1.0d0 - (y / t))
if (z <= (-1.12d+234)) then
tmp = y * (z / t)
else if (z <= (-2.45d+177)) then
tmp = t_1
else if (z <= (-2.3d+96)) then
tmp = (y * z) / t
else if (z <= 1.32d+107) then
tmp = t_1
else
tmp = z * (y / 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 (z <= -1.12e+234) {
tmp = y * (z / t);
} else if (z <= -2.45e+177) {
tmp = t_1;
} else if (z <= -2.3e+96) {
tmp = (y * z) / t;
} else if (z <= 1.32e+107) {
tmp = t_1;
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) tmp = 0 if z <= -1.12e+234: tmp = y * (z / t) elif z <= -2.45e+177: tmp = t_1 elif z <= -2.3e+96: tmp = (y * z) / t elif z <= 1.32e+107: tmp = t_1 else: tmp = z * (y / t) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (z <= -1.12e+234) tmp = Float64(y * Float64(z / t)); elseif (z <= -2.45e+177) tmp = t_1; elseif (z <= -2.3e+96) tmp = Float64(Float64(y * z) / t); elseif (z <= 1.32e+107) tmp = t_1; else tmp = Float64(z * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / t)); tmp = 0.0; if (z <= -1.12e+234) tmp = y * (z / t); elseif (z <= -2.45e+177) tmp = t_1; elseif (z <= -2.3e+96) tmp = (y * z) / t; elseif (z <= 1.32e+107) tmp = t_1; else tmp = z * (y / 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[z, -1.12e+234], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.45e+177], t$95$1, If[LessEqual[z, -2.3e+96], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.32e+107], t$95$1, N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;z \leq -1.12 \cdot 10^{+234}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{+177}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{+96}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+107}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -1.12000000000000004e234Initial program 87.3%
Taylor expanded in y around -inf 61.6%
Taylor expanded in z around inf 54.9%
associate-/l*67.6%
Simplified67.6%
if -1.12000000000000004e234 < z < -2.4500000000000001e177 or -2.30000000000000015e96 < z < 1.32000000000000003e107Initial program 93.6%
Taylor expanded in x around inf 77.0%
mul-1-neg77.0%
unsub-neg77.0%
Simplified77.0%
if -2.4500000000000001e177 < z < -2.30000000000000015e96Initial program 99.8%
Taylor expanded in y around -inf 93.7%
Taylor expanded in z around inf 87.4%
if 1.32000000000000003e107 < z Initial program 86.7%
Taylor expanded in y around -inf 68.4%
Taylor expanded in z around inf 68.2%
associate-/l*63.7%
Simplified63.7%
clear-num63.8%
un-div-inv66.0%
Applied egg-rr66.0%
associate-/r/79.1%
Applied egg-rr79.1%
Final simplification77.4%
(FPCore (x y z t)
:precision binary64
(if (<= t -6.8e+67)
x
(if (<= t -7.8e-60)
(/ y (/ t z))
(if (<= t -4.4e-295)
(/ (- (* x y)) t)
(if (<= t 1750000.0) (/ (* y z) t) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -6.8e+67) {
tmp = x;
} else if (t <= -7.8e-60) {
tmp = y / (t / z);
} else if (t <= -4.4e-295) {
tmp = -(x * y) / t;
} else if (t <= 1750000.0) {
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 <= (-6.8d+67)) then
tmp = x
else if (t <= (-7.8d-60)) then
tmp = y / (t / z)
else if (t <= (-4.4d-295)) then
tmp = -(x * y) / t
else if (t <= 1750000.0d0) 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 <= -6.8e+67) {
tmp = x;
} else if (t <= -7.8e-60) {
tmp = y / (t / z);
} else if (t <= -4.4e-295) {
tmp = -(x * y) / t;
} else if (t <= 1750000.0) {
tmp = (y * z) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -6.8e+67: tmp = x elif t <= -7.8e-60: tmp = y / (t / z) elif t <= -4.4e-295: tmp = -(x * y) / t elif t <= 1750000.0: tmp = (y * z) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -6.8e+67) tmp = x; elseif (t <= -7.8e-60) tmp = Float64(y / Float64(t / z)); elseif (t <= -4.4e-295) tmp = Float64(Float64(-Float64(x * y)) / t); elseif (t <= 1750000.0) tmp = Float64(Float64(y * z) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -6.8e+67) tmp = x; elseif (t <= -7.8e-60) tmp = y / (t / z); elseif (t <= -4.4e-295) tmp = -(x * y) / t; elseif (t <= 1750000.0) tmp = (y * z) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -6.8e+67], x, If[LessEqual[t, -7.8e-60], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.4e-295], N[((-N[(x * y), $MachinePrecision]) / t), $MachinePrecision], If[LessEqual[t, 1750000.0], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+67}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -7.8 \cdot 10^{-60}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq -4.4 \cdot 10^{-295}:\\
\;\;\;\;\frac{-x \cdot y}{t}\\
\mathbf{elif}\;t \leq 1750000:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -6.8000000000000003e67 or 1.75e6 < t Initial program 86.5%
Taylor expanded in y around 0 65.1%
if -6.8000000000000003e67 < t < -7.8000000000000004e-60Initial program 96.3%
Taylor expanded in y around -inf 65.2%
Taylor expanded in z around inf 49.2%
associate-/l*52.6%
Simplified52.6%
clear-num52.5%
un-div-inv52.8%
Applied egg-rr52.8%
if -7.8000000000000004e-60 < t < -4.4000000000000004e-295Initial program 97.7%
Taylor expanded in y around -inf 84.4%
Taylor expanded in z around 0 56.4%
mul-1-neg56.4%
distribute-lft-neg-out56.4%
*-commutative56.4%
Simplified56.4%
if -4.4000000000000004e-295 < t < 1.75e6Initial program 99.9%
Taylor expanded in y around -inf 88.2%
Taylor expanded in z around inf 61.3%
Final simplification61.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (/ y t))))
(if (<= y -18000000.0)
t_1
(if (<= y 3.2e-32) x (if (<= y 1.25e+192) t_1 (* x (/ y (- t))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (y / t);
double tmp;
if (y <= -18000000.0) {
tmp = t_1;
} else if (y <= 3.2e-32) {
tmp = x;
} else if (y <= 1.25e+192) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = z * (y / t)
if (y <= (-18000000.0d0)) then
tmp = t_1
else if (y <= 3.2d-32) then
tmp = x
else if (y <= 1.25d+192) then
tmp = t_1
else
tmp = x * (y / -t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (y / t);
double tmp;
if (y <= -18000000.0) {
tmp = t_1;
} else if (y <= 3.2e-32) {
tmp = x;
} else if (y <= 1.25e+192) {
tmp = t_1;
} else {
tmp = x * (y / -t);
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (y / t) tmp = 0 if y <= -18000000.0: tmp = t_1 elif y <= 3.2e-32: tmp = x elif y <= 1.25e+192: tmp = t_1 else: tmp = x * (y / -t) return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(y / t)) tmp = 0.0 if (y <= -18000000.0) tmp = t_1; elseif (y <= 3.2e-32) tmp = x; elseif (y <= 1.25e+192) tmp = t_1; else tmp = Float64(x * Float64(y / Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (y / t); tmp = 0.0; if (y <= -18000000.0) tmp = t_1; elseif (y <= 3.2e-32) tmp = x; elseif (y <= 1.25e+192) tmp = t_1; else tmp = x * (y / -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -18000000.0], t$95$1, If[LessEqual[y, 3.2e-32], x, If[LessEqual[y, 1.25e+192], t$95$1, N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{t}\\
\mathbf{if}\;y \leq -18000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-32}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{-t}\\
\end{array}
\end{array}
if y < -1.8e7 or 3.2000000000000002e-32 < y < 1.25000000000000008e192Initial program 87.7%
Taylor expanded in y around -inf 71.4%
Taylor expanded in z around inf 47.6%
associate-/l*52.6%
Simplified52.6%
clear-num51.8%
un-div-inv51.8%
Applied egg-rr51.8%
associate-/r/54.0%
Applied egg-rr54.0%
if -1.8e7 < y < 3.2000000000000002e-32Initial program 99.1%
Taylor expanded in y around 0 65.8%
if 1.25000000000000008e192 < y Initial program 82.7%
Taylor expanded in y around -inf 74.1%
Taylor expanded in z around 0 51.7%
mul-1-neg51.7%
associate-/l*57.1%
distribute-rgt-neg-in57.1%
mul-1-neg57.1%
associate-*r/57.1%
mul-1-neg57.1%
Simplified57.1%
Final simplification59.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (/ y t))))
(if (<= y -21000000.0)
t_1
(if (<= y 1.3e-44) x (if (<= y 7.8e+191) t_1 (/ x (/ t (- y))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (y / t);
double tmp;
if (y <= -21000000.0) {
tmp = t_1;
} else if (y <= 1.3e-44) {
tmp = x;
} else if (y <= 7.8e+191) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = z * (y / t)
if (y <= (-21000000.0d0)) then
tmp = t_1
else if (y <= 1.3d-44) then
tmp = x
else if (y <= 7.8d+191) then
tmp = t_1
else
tmp = x / (t / -y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (y / t);
double tmp;
if (y <= -21000000.0) {
tmp = t_1;
} else if (y <= 1.3e-44) {
tmp = x;
} else if (y <= 7.8e+191) {
tmp = t_1;
} else {
tmp = x / (t / -y);
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (y / t) tmp = 0 if y <= -21000000.0: tmp = t_1 elif y <= 1.3e-44: tmp = x elif y <= 7.8e+191: tmp = t_1 else: tmp = x / (t / -y) return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(y / t)) tmp = 0.0 if (y <= -21000000.0) tmp = t_1; elseif (y <= 1.3e-44) tmp = x; elseif (y <= 7.8e+191) tmp = t_1; else tmp = Float64(x / Float64(t / Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (y / t); tmp = 0.0; if (y <= -21000000.0) tmp = t_1; elseif (y <= 1.3e-44) tmp = x; elseif (y <= 7.8e+191) tmp = t_1; else tmp = x / (t / -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -21000000.0], t$95$1, If[LessEqual[y, 1.3e-44], x, If[LessEqual[y, 7.8e+191], t$95$1, N[(x / N[(t / (-y)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{t}\\
\mathbf{if}\;y \leq -21000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t}{-y}}\\
\end{array}
\end{array}
if y < -2.1e7 or 1.2999999999999999e-44 < y < 7.8000000000000001e191Initial program 87.7%
Taylor expanded in y around -inf 71.4%
Taylor expanded in z around inf 47.6%
associate-/l*52.6%
Simplified52.6%
clear-num51.8%
un-div-inv51.8%
Applied egg-rr51.8%
associate-/r/54.0%
Applied egg-rr54.0%
if -2.1e7 < y < 1.2999999999999999e-44Initial program 99.1%
Taylor expanded in y around 0 65.8%
if 7.8000000000000001e191 < y Initial program 82.7%
Taylor expanded in y around -inf 74.1%
Taylor expanded in z around 0 51.7%
mul-1-neg51.7%
associate-/l*57.1%
distribute-rgt-neg-in57.1%
mul-1-neg57.1%
associate-*r/57.1%
mul-1-neg57.1%
Simplified57.1%
add-sqr-sqrt0.0%
sqrt-unprod5.9%
sqr-neg5.9%
sqrt-unprod6.4%
add-sqr-sqrt6.4%
clear-num6.4%
div-inv6.4%
frac-2neg6.4%
distribute-frac-neg26.4%
add-sqr-sqrt0.0%
sqrt-unprod38.1%
sqr-neg38.1%
sqrt-unprod57.1%
add-sqr-sqrt57.2%
Applied egg-rr57.2%
Final simplification59.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -18000000.0) (not (<= y 3.3e-33))) (* y (/ (- z x) t)) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -18000000.0) || !(y <= 3.3e-33)) {
tmp = y * ((z - x) / t);
} else {
tmp = x * (1.0 - (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 <= (-18000000.0d0)) .or. (.not. (y <= 3.3d-33))) then
tmp = y * ((z - x) / t)
else
tmp = x * (1.0d0 - (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -18000000.0) || !(y <= 3.3e-33)) {
tmp = y * ((z - x) / t);
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -18000000.0) or not (y <= 3.3e-33): tmp = y * ((z - x) / t) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -18000000.0) || !(y <= 3.3e-33)) tmp = Float64(y * Float64(Float64(z - x) / t)); else tmp = Float64(x * Float64(1.0 - Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -18000000.0) || ~((y <= 3.3e-33))) tmp = y * ((z - x) / t); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -18000000.0], N[Not[LessEqual[y, 3.3e-33]], $MachinePrecision]], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -18000000 \lor \neg \left(y \leq 3.3 \cdot 10^{-33}\right):\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if y < -1.8e7 or 3.3000000000000003e-33 < y Initial program 86.9%
Taylor expanded in y around -inf 71.8%
associate-/l*80.3%
*-commutative80.3%
Applied egg-rr80.3%
if -1.8e7 < y < 3.3000000000000003e-33Initial program 99.1%
Taylor expanded in x around inf 75.7%
mul-1-neg75.7%
unsub-neg75.7%
Simplified75.7%
Final simplification78.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.05e+15) (not (<= x 6.5e+48))) (* x (- 1.0 (/ y t))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.05e+15) || !(x <= 6.5e+48)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (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 <= (-3.05d+15)) .or. (.not. (x <= 6.5d+48))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = x + (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 <= -3.05e+15) || !(x <= 6.5e+48)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.05e+15) or not (x <= 6.5e+48): tmp = x * (1.0 - (y / t)) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.05e+15) || !(x <= 6.5e+48)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.05e+15) || ~((x <= 6.5e+48))) tmp = x * (1.0 - (y / t)); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.05e+15], N[Not[LessEqual[x, 6.5e+48]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.05 \cdot 10^{+15} \lor \neg \left(x \leq 6.5 \cdot 10^{+48}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -3.05e15 or 6.49999999999999972e48 < x Initial program 89.0%
Taylor expanded in x around inf 88.9%
mul-1-neg88.9%
unsub-neg88.9%
Simplified88.9%
if -3.05e15 < x < 6.49999999999999972e48Initial program 95.3%
Taylor expanded in z around inf 86.7%
associate-/l*52.8%
Simplified85.9%
Final simplification87.2%
(FPCore (x y z t) :precision binary64 (if (<= t -6.2e-59) (+ x (* y (/ z t))) (if (<= t 54.0) (/ (* y (- z x)) t) (+ x (* z (/ y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -6.2e-59) {
tmp = x + (y * (z / t));
} else if (t <= 54.0) {
tmp = (y * (z - x)) / 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 <= (-6.2d-59)) then
tmp = x + (y * (z / t))
else if (t <= 54.0d0) then
tmp = (y * (z - x)) / 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 <= -6.2e-59) {
tmp = x + (y * (z / t));
} else if (t <= 54.0) {
tmp = (y * (z - x)) / t;
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -6.2e-59: tmp = x + (y * (z / t)) elif t <= 54.0: tmp = (y * (z - x)) / t else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -6.2e-59) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (t <= 54.0) tmp = Float64(Float64(y * Float64(z - x)) / t); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -6.2e-59) tmp = x + (y * (z / t)); elseif (t <= 54.0) tmp = (y * (z - x)) / t; else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -6.2e-59], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 54.0], N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{-59}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 54:\\
\;\;\;\;\frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -6.19999999999999998e-59Initial program 85.2%
Taylor expanded in z around inf 80.6%
associate-/l*35.3%
Simplified84.9%
if -6.19999999999999998e-59 < t < 54Initial program 98.9%
Taylor expanded in y around -inf 86.7%
if 54 < t Initial program 91.6%
Taylor expanded in z around inf 87.6%
associate-/l*26.2%
Simplified93.7%
clear-num26.1%
un-div-inv26.1%
Applied egg-rr93.7%
associate-/r/26.9%
Applied egg-rr95.1%
Final simplification88.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -21000000.0) (not (<= y 3.8e-44))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -21000000.0) || !(y <= 3.8e-44)) {
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 ((y <= (-21000000.0d0)) .or. (.not. (y <= 3.8d-44))) 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 ((y <= -21000000.0) || !(y <= 3.8e-44)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -21000000.0) or not (y <= 3.8e-44): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -21000000.0) || !(y <= 3.8e-44)) 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 ((y <= -21000000.0) || ~((y <= 3.8e-44))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -21000000.0], N[Not[LessEqual[y, 3.8e-44]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -21000000 \lor \neg \left(y \leq 3.8 \cdot 10^{-44}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.1e7 or 3.8000000000000001e-44 < y Initial program 86.9%
Taylor expanded in y around -inf 71.8%
Taylor expanded in z around inf 44.7%
associate-/l*50.3%
Simplified50.3%
if -2.1e7 < y < 3.8000000000000001e-44Initial program 99.1%
Taylor expanded in y around 0 65.8%
Final simplification57.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -21000000.0) (not (<= y 4.6e-39))) (* z (/ y t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -21000000.0) || !(y <= 4.6e-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 ((y <= (-21000000.0d0)) .or. (.not. (y <= 4.6d-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 ((y <= -21000000.0) || !(y <= 4.6e-39)) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -21000000.0) or not (y <= 4.6e-39): tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -21000000.0) || !(y <= 4.6e-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 ((y <= -21000000.0) || ~((y <= 4.6e-39))) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -21000000.0], N[Not[LessEqual[y, 4.6e-39]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -21000000 \lor \neg \left(y \leq 4.6 \cdot 10^{-39}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.1e7 or 4.60000000000000016e-39 < y Initial program 86.9%
Taylor expanded in y around -inf 71.8%
Taylor expanded in z around inf 44.7%
associate-/l*50.3%
Simplified50.3%
clear-num49.7%
un-div-inv49.7%
Applied egg-rr49.7%
associate-/r/51.6%
Applied egg-rr51.6%
if -2.1e7 < y < 4.60000000000000016e-39Initial program 99.1%
Taylor expanded in y around 0 65.8%
Final simplification58.1%
(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 92.5%
Taylor expanded in z around 0 87.8%
+-commutative87.8%
*-commutative87.8%
associate-*r/86.6%
mul-1-neg86.6%
associate-/l*89.4%
distribute-lft-neg-in89.4%
distribute-rgt-in96.6%
sub-neg96.6%
Simplified96.6%
Final simplification96.6%
(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 92.5%
Taylor expanded in y around 0 41.3%
Final simplification41.3%
(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 2024079
(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)))