
(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / 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 - x) * z) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / t);
}
def code(x, y, z, t): return x + (((y - x) * z) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(y - x) * z) / t)) end
function tmp = code(x, y, z, t) tmp = x + (((y - x) * z) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot z}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / 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 - x) * z) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / t);
}
def code(x, y, z, t): return x + (((y - x) * z) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(y - x) * z) / t)) end
function tmp = code(x, y, z, t) tmp = x + (((y - x) * z) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot z}{t}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y x) z) t))))
(if (<= t_1 (- INFINITY))
(+ x (/ (- y x) (/ t z)))
(if (<= t_1 5e+298) t_1 (* (- y x) (/ z t))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) * z) / t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + ((y - x) / (t / z));
} else if (t_1 <= 5e+298) {
tmp = t_1;
} else {
tmp = (y - x) * (z / t);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) * z) / t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((y - x) / (t / z));
} else if (t_1 <= 5e+298) {
tmp = t_1;
} else {
tmp = (y - x) * (z / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (((y - x) * z) / t) tmp = 0 if t_1 <= -math.inf: tmp = x + ((y - x) / (t / z)) elif t_1 <= 5e+298: tmp = t_1 else: tmp = (y - x) * (z / t) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(Float64(y - x) * z) / t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(y - x) / Float64(t / z))); elseif (t_1 <= 5e+298) tmp = t_1; else tmp = Float64(Float64(y - x) * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (((y - x) * z) / t); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((y - x) / (t / z)); elseif (t_1 <= 5e+298) tmp = t_1; else tmp = (y - x) * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+298], t$95$1, N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < -inf.0Initial program 75.7%
associate-/l*100.0%
Simplified100.0%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < 5.0000000000000003e298Initial program 99.3%
if 5.0000000000000003e298 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) Initial program 82.6%
Taylor expanded in t around 0 82.6%
associate-/l*100.0%
clear-num99.9%
associate-/r/100.0%
clear-num100.0%
Applied egg-rr100.0%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y x) z) t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+298)))
(* (- y x) (/ z t))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) * z) / t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+298)) {
tmp = (y - x) * (z / t);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) * z) / t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+298)) {
tmp = (y - x) * (z / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (((y - x) * z) / t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+298): tmp = (y - x) * (z / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(Float64(y - x) * z) / t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+298)) tmp = Float64(Float64(y - x) * Float64(z / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (((y - x) * z) / t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+298))) tmp = (y - x) * (z / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+298]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+298}\right):\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < -inf.0 or 5.0000000000000003e298 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) Initial program 78.8%
Taylor expanded in t around 0 78.8%
associate-/l*95.8%
clear-num95.8%
associate-/r/95.8%
clear-num95.8%
Applied egg-rr95.8%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < 5.0000000000000003e298Initial program 99.3%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -1.45e-115)
(not (or (<= z 2.5e-79) (and (not (<= z 1.4e-56)) (<= z 0.32)))))
(* (- y x) (/ z t))
x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.45e-115) || !((z <= 2.5e-79) || (!(z <= 1.4e-56) && (z <= 0.32)))) {
tmp = (y - x) * (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.45d-115)) .or. (.not. (z <= 2.5d-79) .or. (.not. (z <= 1.4d-56)) .and. (z <= 0.32d0))) then
tmp = (y - x) * (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.45e-115) || !((z <= 2.5e-79) || (!(z <= 1.4e-56) && (z <= 0.32)))) {
tmp = (y - x) * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.45e-115) or not ((z <= 2.5e-79) or (not (z <= 1.4e-56) and (z <= 0.32))): tmp = (y - x) * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.45e-115) || !((z <= 2.5e-79) || (!(z <= 1.4e-56) && (z <= 0.32)))) tmp = Float64(Float64(y - x) * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.45e-115) || ~(((z <= 2.5e-79) || (~((z <= 1.4e-56)) && (z <= 0.32))))) tmp = (y - x) * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.45e-115], N[Not[Or[LessEqual[z, 2.5e-79], And[N[Not[LessEqual[z, 1.4e-56]], $MachinePrecision], LessEqual[z, 0.32]]]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-115} \lor \neg \left(z \leq 2.5 \cdot 10^{-79} \lor \neg \left(z \leq 1.4 \cdot 10^{-56}\right) \land z \leq 0.32\right):\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.4499999999999999e-115 or 2.5e-79 < z < 1.39999999999999997e-56 or 0.320000000000000007 < z Initial program 90.0%
Taylor expanded in t around 0 76.7%
associate-/l*79.9%
clear-num79.8%
associate-/r/79.8%
clear-num79.8%
Applied egg-rr79.8%
if -1.4499999999999999e-115 < z < 2.5e-79 or 1.39999999999999997e-56 < z < 0.320000000000000007Initial program 99.0%
Taylor expanded in z around 0 73.2%
Final simplification77.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.6e-105)
(/ y (/ t z))
(if (<= z 0.35)
x
(if (<= z 3.7e+236)
(* z (/ y t))
(if (<= z 1.1e+277) (* z (- (/ x t))) (* y (/ z t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.6e-105) {
tmp = y / (t / z);
} else if (z <= 0.35) {
tmp = x;
} else if (z <= 3.7e+236) {
tmp = z * (y / t);
} else if (z <= 1.1e+277) {
tmp = z * -(x / 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 (z <= (-4.6d-105)) then
tmp = y / (t / z)
else if (z <= 0.35d0) then
tmp = x
else if (z <= 3.7d+236) then
tmp = z * (y / t)
else if (z <= 1.1d+277) then
tmp = z * -(x / 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 (z <= -4.6e-105) {
tmp = y / (t / z);
} else if (z <= 0.35) {
tmp = x;
} else if (z <= 3.7e+236) {
tmp = z * (y / t);
} else if (z <= 1.1e+277) {
tmp = z * -(x / t);
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.6e-105: tmp = y / (t / z) elif z <= 0.35: tmp = x elif z <= 3.7e+236: tmp = z * (y / t) elif z <= 1.1e+277: tmp = z * -(x / t) else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.6e-105) tmp = Float64(y / Float64(t / z)); elseif (z <= 0.35) tmp = x; elseif (z <= 3.7e+236) tmp = Float64(z * Float64(y / t)); elseif (z <= 1.1e+277) tmp = Float64(z * Float64(-Float64(x / t))); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.6e-105) tmp = y / (t / z); elseif (z <= 0.35) tmp = x; elseif (z <= 3.7e+236) tmp = z * (y / t); elseif (z <= 1.1e+277) tmp = z * -(x / t); else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.6e-105], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.35], x, If[LessEqual[z, 3.7e+236], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+277], N[(z * (-N[(x / t), $MachinePrecision])), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 0.35:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+236}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+277}:\\
\;\;\;\;z \cdot \left(-\frac{x}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -4.6000000000000002e-105Initial program 88.5%
Taylor expanded in t around 0 74.0%
Taylor expanded in y around inf 49.8%
associate-/l*55.1%
Simplified55.1%
if -4.6000000000000002e-105 < z < 0.34999999999999998Initial program 99.1%
Taylor expanded in z around 0 69.0%
if 0.34999999999999998 < z < 3.70000000000000014e236Initial program 86.8%
Taylor expanded in t around 0 75.3%
Taylor expanded in y around inf 49.6%
associate-*l/56.5%
*-commutative56.5%
Simplified56.5%
if 3.70000000000000014e236 < z < 1.09999999999999998e277Initial program 99.9%
Taylor expanded in x around inf 74.2%
*-commutative74.2%
distribute-lft-in74.2%
*-rgt-identity74.2%
mul-1-neg74.2%
distribute-rgt-neg-in74.2%
unsub-neg74.2%
Simplified74.2%
associate-*r/82.5%
add-cube-cbrt82.0%
times-frac82.1%
add-sqr-sqrt63.4%
sqrt-unprod63.7%
sqr-neg63.7%
sqrt-unprod0.5%
add-sqr-sqrt0.7%
times-frac0.7%
*-commutative0.7%
add-cube-cbrt0.7%
associate-/l*0.5%
add-sqr-sqrt0.3%
sqrt-unprod63.8%
sqr-neg63.8%
sqrt-unprod63.1%
add-sqr-sqrt82.4%
Applied egg-rr82.4%
Taylor expanded in z around inf 82.5%
mul-1-neg82.5%
associate-*r/82.3%
distribute-rgt-neg-out82.3%
distribute-neg-frac82.3%
Simplified82.3%
if 1.09999999999999998e277 < z Initial program 99.7%
Taylor expanded in t around 0 99.7%
Taylor expanded in y around inf 60.5%
*-commutative60.5%
Simplified60.5%
associate-/l*41.4%
associate-/r/60.5%
Applied egg-rr60.5%
Final simplification62.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.7e-106)
(/ y (/ t z))
(if (<= z 0.58)
x
(if (<= z 6.5e+237)
(* z (/ y t))
(if (<= z 1.15e+277) (/ (- z) (/ t x)) (* y (/ z t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e-106) {
tmp = y / (t / z);
} else if (z <= 0.58) {
tmp = x;
} else if (z <= 6.5e+237) {
tmp = z * (y / t);
} else if (z <= 1.15e+277) {
tmp = -z / (t / x);
} 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 (z <= (-2.7d-106)) then
tmp = y / (t / z)
else if (z <= 0.58d0) then
tmp = x
else if (z <= 6.5d+237) then
tmp = z * (y / t)
else if (z <= 1.15d+277) then
tmp = -z / (t / x)
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 (z <= -2.7e-106) {
tmp = y / (t / z);
} else if (z <= 0.58) {
tmp = x;
} else if (z <= 6.5e+237) {
tmp = z * (y / t);
} else if (z <= 1.15e+277) {
tmp = -z / (t / x);
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.7e-106: tmp = y / (t / z) elif z <= 0.58: tmp = x elif z <= 6.5e+237: tmp = z * (y / t) elif z <= 1.15e+277: tmp = -z / (t / x) else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.7e-106) tmp = Float64(y / Float64(t / z)); elseif (z <= 0.58) tmp = x; elseif (z <= 6.5e+237) tmp = Float64(z * Float64(y / t)); elseif (z <= 1.15e+277) tmp = Float64(Float64(-z) / Float64(t / x)); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.7e-106) tmp = y / (t / z); elseif (z <= 0.58) tmp = x; elseif (z <= 6.5e+237) tmp = z * (y / t); elseif (z <= 1.15e+277) tmp = -z / (t / x); else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.7e-106], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.58], x, If[LessEqual[z, 6.5e+237], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+277], N[((-z) / N[(t / x), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-106}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 0.58:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+237}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+277}:\\
\;\;\;\;\frac{-z}{\frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -2.70000000000000022e-106Initial program 88.5%
Taylor expanded in t around 0 74.0%
Taylor expanded in y around inf 49.8%
associate-/l*55.1%
Simplified55.1%
if -2.70000000000000022e-106 < z < 0.57999999999999996Initial program 99.1%
Taylor expanded in z around 0 69.0%
if 0.57999999999999996 < z < 6.4999999999999999e237Initial program 86.8%
Taylor expanded in t around 0 75.3%
Taylor expanded in y around inf 49.6%
associate-*l/56.5%
*-commutative56.5%
Simplified56.5%
if 6.4999999999999999e237 < z < 1.14999999999999997e277Initial program 99.9%
Taylor expanded in t around 0 99.9%
associate-/l*91.7%
clear-num91.6%
associate-/r/91.7%
clear-num91.7%
Applied egg-rr91.7%
Taylor expanded in y around 0 82.5%
mul-1-neg82.5%
associate-/l*82.5%
distribute-neg-frac82.5%
Simplified82.5%
if 1.14999999999999997e277 < z Initial program 99.7%
Taylor expanded in t around 0 99.7%
Taylor expanded in y around inf 60.5%
*-commutative60.5%
Simplified60.5%
associate-/l*41.4%
associate-/r/60.5%
Applied egg-rr60.5%
Final simplification62.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1.8e-112) (/ y (/ t z)) (if (<= z 0.48) x (if (<= z 3.1e+238) (* z (/ y t)) (- (/ (* x z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-112) {
tmp = y / (t / z);
} else if (z <= 0.48) {
tmp = x;
} else if (z <= 3.1e+238) {
tmp = z * (y / t);
} else {
tmp = -((x * 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 (z <= (-1.8d-112)) then
tmp = y / (t / z)
else if (z <= 0.48d0) then
tmp = x
else if (z <= 3.1d+238) then
tmp = z * (y / t)
else
tmp = -((x * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-112) {
tmp = y / (t / z);
} else if (z <= 0.48) {
tmp = x;
} else if (z <= 3.1e+238) {
tmp = z * (y / t);
} else {
tmp = -((x * z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e-112: tmp = y / (t / z) elif z <= 0.48: tmp = x elif z <= 3.1e+238: tmp = z * (y / t) else: tmp = -((x * z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e-112) tmp = Float64(y / Float64(t / z)); elseif (z <= 0.48) tmp = x; elseif (z <= 3.1e+238) tmp = Float64(z * Float64(y / t)); else tmp = Float64(-Float64(Float64(x * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.8e-112) tmp = y / (t / z); elseif (z <= 0.48) tmp = x; elseif (z <= 3.1e+238) tmp = z * (y / t); else tmp = -((x * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e-112], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.48], x, If[LessEqual[z, 3.1e+238], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], (-N[(N[(x * z), $MachinePrecision] / t), $MachinePrecision])]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-112}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 0.48:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+238}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.8e-112Initial program 88.5%
Taylor expanded in t around 0 74.0%
Taylor expanded in y around inf 49.8%
associate-/l*55.1%
Simplified55.1%
if -1.8e-112 < z < 0.47999999999999998Initial program 99.1%
Taylor expanded in z around 0 69.0%
if 0.47999999999999998 < z < 3.10000000000000012e238Initial program 86.8%
Taylor expanded in t around 0 75.3%
Taylor expanded in y around inf 49.6%
associate-*l/56.5%
*-commutative56.5%
Simplified56.5%
if 3.10000000000000012e238 < z Initial program 99.8%
Taylor expanded in t around 0 99.8%
Taylor expanded in y around 0 69.4%
mul-1-neg69.4%
distribute-rgt-neg-out69.4%
Simplified69.4%
Final simplification62.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.25e-11) (not (<= z 9.6e+30))) (* (- y x) (/ z t)) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.25e-11) || !(z <= 9.6e+30)) {
tmp = (y - x) * (z / 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 ((z <= (-1.25d-11)) .or. (.not. (z <= 9.6d+30))) then
tmp = (y - x) * (z / 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 ((z <= -1.25e-11) || !(z <= 9.6e+30)) {
tmp = (y - x) * (z / t);
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.25e-11) or not (z <= 9.6e+30): tmp = (y - x) * (z / t) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.25e-11) || !(z <= 9.6e+30)) tmp = Float64(Float64(y - x) * Float64(z / 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 ((z <= -1.25e-11) || ~((z <= 9.6e+30))) tmp = (y - x) * (z / t); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.25e-11], N[Not[LessEqual[z, 9.6e+30]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-11} \lor \neg \left(z \leq 9.6 \cdot 10^{+30}\right):\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -1.25000000000000005e-11 or 9.5999999999999997e30 < z Initial program 86.4%
Taylor expanded in t around 0 79.2%
associate-/l*83.6%
clear-num83.5%
associate-/r/83.4%
clear-num83.5%
Applied egg-rr83.5%
if -1.25000000000000005e-11 < z < 9.5999999999999997e30Initial program 99.3%
Taylor expanded in y around inf 90.3%
associate-*l/25.6%
*-commutative25.6%
Simplified85.1%
Final simplification84.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9e-11) (not (<= z 3.9e+31))) (* (- y x) (/ z t)) (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e-11) || !(z <= 3.9e+31)) {
tmp = (y - x) * (z / t);
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-9d-11)) .or. (.not. (z <= 3.9d+31))) then
tmp = (y - x) * (z / t)
else
tmp = x + (y / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e-11) || !(z <= 3.9e+31)) {
tmp = (y - x) * (z / t);
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9e-11) or not (z <= 3.9e+31): tmp = (y - x) * (z / t) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9e-11) || !(z <= 3.9e+31)) tmp = Float64(Float64(y - x) * Float64(z / t)); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9e-11) || ~((z <= 3.9e+31))) tmp = (y - x) * (z / t); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9e-11], N[Not[LessEqual[z, 3.9e+31]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-11} \lor \neg \left(z \leq 3.9 \cdot 10^{+31}\right):\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if z < -8.9999999999999999e-11 or 3.89999999999999999e31 < z Initial program 86.4%
Taylor expanded in t around 0 79.2%
associate-/l*83.6%
clear-num83.5%
associate-/r/83.4%
clear-num83.5%
Applied egg-rr83.5%
if -8.9999999999999999e-11 < z < 3.89999999999999999e31Initial program 99.3%
Taylor expanded in y around inf 90.3%
associate-/l*30.6%
Simplified89.9%
Final simplification87.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.65e+36) (not (<= y 7.5e-140))) (+ x (/ y (/ t z))) (- x (* x (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.65e+36) || !(y <= 7.5e-140)) {
tmp = x + (y / (t / z));
} else {
tmp = x - (x * (z / t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.65d+36)) .or. (.not. (y <= 7.5d-140))) then
tmp = x + (y / (t / z))
else
tmp = x - (x * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.65e+36) || !(y <= 7.5e-140)) {
tmp = x + (y / (t / z));
} else {
tmp = x - (x * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.65e+36) or not (y <= 7.5e-140): tmp = x + (y / (t / z)) else: tmp = x - (x * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.65e+36) || !(y <= 7.5e-140)) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x - Float64(x * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.65e+36) || ~((y <= 7.5e-140))) tmp = x + (y / (t / z)); else tmp = x - (x * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.65e+36], N[Not[LessEqual[y, 7.5e-140]], $MachinePrecision]], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{+36} \lor \neg \left(y \leq 7.5 \cdot 10^{-140}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{z}{t}\\
\end{array}
\end{array}
if y < -2.65e36 or 7.4999999999999998e-140 < y Initial program 91.1%
Taylor expanded in y around inf 83.8%
associate-/l*58.2%
Simplified89.6%
if -2.65e36 < y < 7.4999999999999998e-140Initial program 97.2%
Taylor expanded in x around inf 83.5%
*-commutative83.5%
distribute-lft-in83.5%
*-rgt-identity83.5%
mul-1-neg83.5%
distribute-rgt-neg-in83.5%
unsub-neg83.5%
Simplified83.5%
Final simplification87.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.8e+37) (not (<= y 6.4e-141))) (+ x (/ y (/ t z))) (- x (/ z (/ t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8e+37) || !(y <= 6.4e-141)) {
tmp = x + (y / (t / z));
} else {
tmp = x - (z / (t / 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 <= (-1.8d+37)) .or. (.not. (y <= 6.4d-141))) then
tmp = x + (y / (t / z))
else
tmp = x - (z / (t / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8e+37) || !(y <= 6.4e-141)) {
tmp = x + (y / (t / z));
} else {
tmp = x - (z / (t / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.8e+37) or not (y <= 6.4e-141): tmp = x + (y / (t / z)) else: tmp = x - (z / (t / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.8e+37) || !(y <= 6.4e-141)) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x - Float64(z / Float64(t / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.8e+37) || ~((y <= 6.4e-141))) tmp = x + (y / (t / z)); else tmp = x - (z / (t / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.8e+37], N[Not[LessEqual[y, 6.4e-141]], $MachinePrecision]], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+37} \lor \neg \left(y \leq 6.4 \cdot 10^{-141}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z}{\frac{t}{x}}\\
\end{array}
\end{array}
if y < -1.79999999999999999e37 or 6.4000000000000003e-141 < y Initial program 91.1%
Taylor expanded in y around inf 83.8%
associate-/l*58.2%
Simplified89.6%
if -1.79999999999999999e37 < y < 6.4000000000000003e-141Initial program 97.2%
Taylor expanded in x around inf 83.5%
*-commutative83.5%
distribute-lft-in83.5%
*-rgt-identity83.5%
mul-1-neg83.5%
distribute-rgt-neg-in83.5%
unsub-neg83.5%
Simplified83.5%
associate-*r/85.2%
add-cube-cbrt85.0%
times-frac86.9%
add-sqr-sqrt42.6%
sqrt-unprod57.3%
sqr-neg57.3%
sqrt-unprod25.3%
add-sqr-sqrt47.4%
times-frac46.4%
*-commutative46.4%
add-cube-cbrt46.4%
associate-/l*47.3%
add-sqr-sqrt25.3%
sqrt-unprod57.3%
sqr-neg57.3%
sqrt-unprod42.6%
add-sqr-sqrt86.2%
Applied egg-rr86.2%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (<= z -2.3e-11) (* z (- (/ y t) (/ x t))) (if (<= z 4.2e+30) (+ x (/ y (/ t z))) (* (- y x) (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e-11) {
tmp = z * ((y / t) - (x / t));
} else if (z <= 4.2e+30) {
tmp = x + (y / (t / z));
} else {
tmp = (y - x) * (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 (z <= (-2.3d-11)) then
tmp = z * ((y / t) - (x / t))
else if (z <= 4.2d+30) then
tmp = x + (y / (t / z))
else
tmp = (y - x) * (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e-11) {
tmp = z * ((y / t) - (x / t));
} else if (z <= 4.2e+30) {
tmp = x + (y / (t / z));
} else {
tmp = (y - x) * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.3e-11: tmp = z * ((y / t) - (x / t)) elif z <= 4.2e+30: tmp = x + (y / (t / z)) else: tmp = (y - x) * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.3e-11) tmp = Float64(z * Float64(Float64(y / t) - Float64(x / t))); elseif (z <= 4.2e+30) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(Float64(y - x) * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.3e-11) tmp = z * ((y / t) - (x / t)); elseif (z <= 4.2e+30) tmp = x + (y / (t / z)); else tmp = (y - x) * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.3e-11], N[(z * N[(N[(y / t), $MachinePrecision] - N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+30], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-11}:\\
\;\;\;\;z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -2.30000000000000014e-11Initial program 83.8%
Taylor expanded in z around inf 86.0%
if -2.30000000000000014e-11 < z < 4.2e30Initial program 99.3%
Taylor expanded in y around inf 90.3%
associate-/l*30.6%
Simplified89.9%
if 4.2e30 < z Initial program 88.8%
Taylor expanded in t around 0 84.0%
associate-/l*87.1%
clear-num86.9%
associate-/r/87.0%
clear-num87.1%
Applied egg-rr87.1%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.9e-114) (not (<= z 0.42))) (* z (/ y t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.9e-114) || !(z <= 0.42)) {
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 <= (-1.9d-114)) .or. (.not. (z <= 0.42d0))) 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 <= -1.9e-114) || !(z <= 0.42)) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.9e-114) or not (z <= 0.42): tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.9e-114) || !(z <= 0.42)) 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 <= -1.9e-114) || ~((z <= 0.42))) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.9e-114], N[Not[LessEqual[z, 0.42]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-114} \lor \neg \left(z \leq 0.42\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.8999999999999999e-114 or 0.419999999999999984 < z Initial program 89.2%
Taylor expanded in t around 0 77.4%
Taylor expanded in y around inf 49.1%
associate-*l/53.6%
*-commutative53.6%
Simplified53.6%
if -1.8999999999999999e-114 < z < 0.419999999999999984Initial program 99.1%
Taylor expanded in z around 0 69.0%
Final simplification60.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.6e-105) (not (<= z 0.34))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.6e-105) || !(z <= 0.34)) {
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 <= (-4.6d-105)) .or. (.not. (z <= 0.34d0))) 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 <= -4.6e-105) || !(z <= 0.34)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.6e-105) or not (z <= 0.34): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.6e-105) || !(z <= 0.34)) 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 <= -4.6e-105) || ~((z <= 0.34))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.6e-105], N[Not[LessEqual[z, 0.34]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-105} \lor \neg \left(z \leq 0.34\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.6000000000000002e-105 or 0.340000000000000024 < z Initial program 89.2%
Taylor expanded in t around 0 77.4%
Taylor expanded in y around inf 49.1%
*-commutative49.1%
Simplified49.1%
associate-/l*53.1%
associate-/r/53.8%
Applied egg-rr53.8%
if -4.6000000000000002e-105 < z < 0.340000000000000024Initial program 99.1%
Taylor expanded in z around 0 69.0%
Final simplification60.6%
(FPCore (x y z t) :precision binary64 (if (<= z -4.4e-105) (/ y (/ t z)) (if (<= z 0.34) x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.4e-105) {
tmp = y / (t / z);
} else if (z <= 0.34) {
tmp = x;
} 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 (z <= (-4.4d-105)) then
tmp = y / (t / z)
else if (z <= 0.34d0) then
tmp = x
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 (z <= -4.4e-105) {
tmp = y / (t / z);
} else if (z <= 0.34) {
tmp = x;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.4e-105: tmp = y / (t / z) elif z <= 0.34: tmp = x else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.4e-105) tmp = Float64(y / Float64(t / z)); elseif (z <= 0.34) tmp = x; else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.4e-105) tmp = y / (t / z); elseif (z <= 0.34) tmp = x; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.4e-105], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.34], x, N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 0.34:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -4.40000000000000008e-105Initial program 88.5%
Taylor expanded in t around 0 74.0%
Taylor expanded in y around inf 49.8%
associate-/l*55.1%
Simplified55.1%
if -4.40000000000000008e-105 < z < 0.340000000000000024Initial program 99.1%
Taylor expanded in z around 0 69.0%
if 0.340000000000000024 < z Initial program 90.0%
Taylor expanded in t around 0 81.2%
Taylor expanded in y around inf 48.3%
*-commutative48.3%
Simplified48.3%
associate-/l*49.8%
associate-/r/52.6%
Applied egg-rr52.6%
Final simplification60.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 93.6%
Taylor expanded in z around 0 39.6%
Final simplification39.6%
(FPCore (x y z t)
:precision binary64
(if (< x -9.025511195533005e-135)
(- x (* (/ z t) (- x y)))
(if (< x 4.275032163700715e-250)
(+ x (* (/ (- y x) t) z))
(+ x (/ (- y x) (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x < -9.025511195533005e-135) {
tmp = x - ((z / t) * (x - y));
} else if (x < 4.275032163700715e-250) {
tmp = x + (((y - x) / t) * z);
} else {
tmp = x + ((y - x) / (t / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x < (-9.025511195533005d-135)) then
tmp = x - ((z / t) * (x - y))
else if (x < 4.275032163700715d-250) then
tmp = x + (((y - x) / t) * z)
else
tmp = x + ((y - x) / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x < -9.025511195533005e-135) {
tmp = x - ((z / t) * (x - y));
} else if (x < 4.275032163700715e-250) {
tmp = x + (((y - x) / t) * z);
} else {
tmp = x + ((y - x) / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x < -9.025511195533005e-135: tmp = x - ((z / t) * (x - y)) elif x < 4.275032163700715e-250: tmp = x + (((y - x) / t) * z) else: tmp = x + ((y - x) / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x < -9.025511195533005e-135) tmp = Float64(x - Float64(Float64(z / t) * Float64(x - y))); elseif (x < 4.275032163700715e-250) tmp = Float64(x + Float64(Float64(Float64(y - x) / t) * z)); else tmp = Float64(x + Float64(Float64(y - x) / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x < -9.025511195533005e-135) tmp = x - ((z / t) * (x - y)); elseif (x < 4.275032163700715e-250) tmp = x + (((y - x) / t) * z); else tmp = x + ((y - x) / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Less[x, -9.025511195533005e-135], N[(x - N[(N[(z / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[x, 4.275032163700715e-250], N[(x + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x < -9.025511195533005 \cdot 10^{-135}:\\
\;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\
\mathbf{elif}\;x < 4.275032163700715 \cdot 10^{-250}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\end{array}
\end{array}
herbie shell --seed 2023185
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))
(+ x (/ (* (- y x) z) t)))