
(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 11 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) t) z))) (t_2 (+ x (/ (* (- y x) z) t)))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 2e+306) t_2 t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) / t) * z);
double t_2 = x + (((y - x) * z) / t);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 2e+306) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) / t) * z);
double t_2 = x + (((y - x) * z) / t);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 2e+306) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (((y - x) / t) * z) t_2 = x + (((y - x) * z) / t) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 2e+306: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(Float64(y - x) / t) * z)) t_2 = Float64(x + Float64(Float64(Float64(y - x) * z) / t)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 2e+306) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (((y - x) / t) * z); t_2 = x + (((y - x) * z) / t); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 2e+306) tmp = t_2; 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] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 2e+306], t$95$2, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{t} \cdot z\\
t_2 := x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < -inf.0 or 2.00000000000000003e306 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) Initial program 74.7%
Applied egg-rr0
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < 2.00000000000000003e306Initial program 99.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.6e+32)
(/ y (/ t z))
(if (<= z -2.7e-26)
x
(if (<= z -1.36e-81) (/ z (/ t y)) (if (<= z 2.8e+30) x (* (/ z t) y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+32) {
tmp = y / (t / z);
} else if (z <= -2.7e-26) {
tmp = x;
} else if (z <= -1.36e-81) {
tmp = z / (t / y);
} else if (z <= 2.8e+30) {
tmp = x;
} else {
tmp = (z / t) * y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.6d+32)) then
tmp = y / (t / z)
else if (z <= (-2.7d-26)) then
tmp = x
else if (z <= (-1.36d-81)) then
tmp = z / (t / y)
else if (z <= 2.8d+30) then
tmp = x
else
tmp = (z / t) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+32) {
tmp = y / (t / z);
} else if (z <= -2.7e-26) {
tmp = x;
} else if (z <= -1.36e-81) {
tmp = z / (t / y);
} else if (z <= 2.8e+30) {
tmp = x;
} else {
tmp = (z / t) * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.6e+32: tmp = y / (t / z) elif z <= -2.7e-26: tmp = x elif z <= -1.36e-81: tmp = z / (t / y) elif z <= 2.8e+30: tmp = x else: tmp = (z / t) * y return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e+32) tmp = Float64(y / Float64(t / z)); elseif (z <= -2.7e-26) tmp = x; elseif (z <= -1.36e-81) tmp = Float64(z / Float64(t / y)); elseif (z <= 2.8e+30) tmp = x; else tmp = Float64(Float64(z / t) * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.6e+32) tmp = y / (t / z); elseif (z <= -2.7e-26) tmp = x; elseif (z <= -1.36e-81) tmp = z / (t / y); elseif (z <= 2.8e+30) tmp = x; else tmp = (z / t) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.6e+32], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.7e-26], x, If[LessEqual[z, -1.36e-81], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+30], x, N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+32}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-26}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.36 \cdot 10^{-81}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+30}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{t} \cdot y\\
\end{array}
\end{array}
if z < -3.5999999999999997e32Initial program 85.7%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -3.5999999999999997e32 < z < -2.69999999999999982e-26 or -1.3599999999999999e-81 < z < 2.79999999999999983e30Initial program 97.9%
Taylor expanded in z around 0 0
Simplified0
if -2.69999999999999982e-26 < z < -1.3599999999999999e-81Initial program 99.6%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if 2.79999999999999983e30 < z Initial program 81.9%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z t) y)))
(if (<= z -1.3e+32)
(/ y (/ t z))
(if (<= z -8.4e-27)
x
(if (<= z -1.45e-81) t_1 (if (<= z 8.2e+40) x t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (z / t) * y;
double tmp;
if (z <= -1.3e+32) {
tmp = y / (t / z);
} else if (z <= -8.4e-27) {
tmp = x;
} else if (z <= -1.45e-81) {
tmp = t_1;
} else if (z <= 8.2e+40) {
tmp = x;
} 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 = (z / t) * y
if (z <= (-1.3d+32)) then
tmp = y / (t / z)
else if (z <= (-8.4d-27)) then
tmp = x
else if (z <= (-1.45d-81)) then
tmp = t_1
else if (z <= 8.2d+40) then
tmp = x
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 = (z / t) * y;
double tmp;
if (z <= -1.3e+32) {
tmp = y / (t / z);
} else if (z <= -8.4e-27) {
tmp = x;
} else if (z <= -1.45e-81) {
tmp = t_1;
} else if (z <= 8.2e+40) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / t) * y tmp = 0 if z <= -1.3e+32: tmp = y / (t / z) elif z <= -8.4e-27: tmp = x elif z <= -1.45e-81: tmp = t_1 elif z <= 8.2e+40: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / t) * y) tmp = 0.0 if (z <= -1.3e+32) tmp = Float64(y / Float64(t / z)); elseif (z <= -8.4e-27) tmp = x; elseif (z <= -1.45e-81) tmp = t_1; elseif (z <= 8.2e+40) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / t) * y; tmp = 0.0; if (z <= -1.3e+32) tmp = y / (t / z); elseif (z <= -8.4e-27) tmp = x; elseif (z <= -1.45e-81) tmp = t_1; elseif (z <= 8.2e+40) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[z, -1.3e+32], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.4e-27], x, If[LessEqual[z, -1.45e-81], t$95$1, If[LessEqual[z, 8.2e+40], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{t} \cdot y\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+32}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq -8.4 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+40}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3000000000000001e32Initial program 85.7%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -1.3000000000000001e32 < z < -8.40000000000000061e-27 or -1.44999999999999994e-81 < z < 8.2000000000000003e40Initial program 97.9%
Taylor expanded in z around 0 0
Simplified0
if -8.40000000000000061e-27 < z < -1.44999999999999994e-81 or 8.2000000000000003e40 < z Initial program 84.2%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ y (/ t z)) x))) (if (<= y -62.0) t_1 (if (<= y 1.55e-10) (* x (- 1.0 (/ z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y / (t / z)) + x;
double tmp;
if (y <= -62.0) {
tmp = t_1;
} else if (y <= 1.55e-10) {
tmp = x * (1.0 - (z / t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y / (t / z)) + x
if (y <= (-62.0d0)) then
tmp = t_1
else if (y <= 1.55d-10) then
tmp = x * (1.0d0 - (z / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y / (t / z)) + x;
double tmp;
if (y <= -62.0) {
tmp = t_1;
} else if (y <= 1.55e-10) {
tmp = x * (1.0 - (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / (t / z)) + x tmp = 0 if y <= -62.0: tmp = t_1 elif y <= 1.55e-10: tmp = x * (1.0 - (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / Float64(t / z)) + x) tmp = 0.0 if (y <= -62.0) tmp = t_1; elseif (y <= 1.55e-10) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / (t / z)) + x; tmp = 0.0; if (y <= -62.0) tmp = t_1; elseif (y <= 1.55e-10) tmp = x * (1.0 - (z / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -62.0], t$95$1, If[LessEqual[y, 1.55e-10], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{t}{z}} + x\\
\mathbf{if}\;y \leq -62:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-10}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -62 or 1.55000000000000008e-10 < y Initial program 89.3%
Applied egg-rr0
Taylor expanded in y around inf 0
Simplified0
if -62 < y < 1.55000000000000008e-10Initial program 94.8%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ x (/ (* z y) t)))) (if (<= y -45.0) t_1 (if (<= y 3.45e-6) (* x (- 1.0 (/ z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((z * y) / t);
double tmp;
if (y <= -45.0) {
tmp = t_1;
} else if (y <= 3.45e-6) {
tmp = x * (1.0 - (z / t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((z * y) / t)
if (y <= (-45.0d0)) then
tmp = t_1
else if (y <= 3.45d-6) then
tmp = x * (1.0d0 - (z / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + ((z * y) / t);
double tmp;
if (y <= -45.0) {
tmp = t_1;
} else if (y <= 3.45e-6) {
tmp = x * (1.0 - (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((z * y) / t) tmp = 0 if y <= -45.0: tmp = t_1 elif y <= 3.45e-6: tmp = x * (1.0 - (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(z * y) / t)) tmp = 0.0 if (y <= -45.0) tmp = t_1; elseif (y <= 3.45e-6) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((z * y) / t); tmp = 0.0; if (y <= -45.0) tmp = t_1; elseif (y <= 3.45e-6) tmp = x * (1.0 - (z / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -45.0], t$95$1, If[LessEqual[y, 3.45e-6], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z \cdot y}{t}\\
\mathbf{if}\;y \leq -45:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.45 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -45 or 3.45e-6 < y Initial program 89.3%
Taylor expanded in y around inf 0
Simplified0
if -45 < y < 3.45e-6Initial program 94.8%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ z t) (- y x)))) (if (<= y -2.8e+82) t_1 (if (<= y 5.6e+150) (* x (- 1.0 (/ z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z / t) * (y - x);
double tmp;
if (y <= -2.8e+82) {
tmp = t_1;
} else if (y <= 5.6e+150) {
tmp = x * (1.0 - (z / t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (z / t) * (y - x)
if (y <= (-2.8d+82)) then
tmp = t_1
else if (y <= 5.6d+150) then
tmp = x * (1.0d0 - (z / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z / t) * (y - x);
double tmp;
if (y <= -2.8e+82) {
tmp = t_1;
} else if (y <= 5.6e+150) {
tmp = x * (1.0 - (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / t) * (y - x) tmp = 0 if y <= -2.8e+82: tmp = t_1 elif y <= 5.6e+150: tmp = x * (1.0 - (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / t) * Float64(y - x)) tmp = 0.0 if (y <= -2.8e+82) tmp = t_1; elseif (y <= 5.6e+150) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / t) * (y - x); tmp = 0.0; if (y <= -2.8e+82) tmp = t_1; elseif (y <= 5.6e+150) tmp = x * (1.0 - (z / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.8e+82], t$95$1, If[LessEqual[y, 5.6e+150], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+150}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.8e82 or 5.60000000000000018e150 < y Initial program 87.6%
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
if -2.8e82 < y < 5.60000000000000018e150Initial program 94.3%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= y -1.25e+83) (* (/ z t) y) (if (<= y 2.3e+151) (* x (- 1.0 (/ z t))) (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+83) {
tmp = (z / t) * y;
} else if (y <= 2.3e+151) {
tmp = x * (1.0 - (z / t));
} else {
tmp = 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 (y <= (-1.25d+83)) then
tmp = (z / t) * y
else if (y <= 2.3d+151) then
tmp = x * (1.0d0 - (z / t))
else
tmp = y / (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+83) {
tmp = (z / t) * y;
} else if (y <= 2.3e+151) {
tmp = x * (1.0 - (z / t));
} else {
tmp = y / (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.25e+83: tmp = (z / t) * y elif y <= 2.3e+151: tmp = x * (1.0 - (z / t)) else: tmp = y / (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e+83) tmp = Float64(Float64(z / t) * y); elseif (y <= 2.3e+151) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = Float64(y / Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.25e+83) tmp = (z / t) * y; elseif (y <= 2.3e+151) tmp = x * (1.0 - (z / t)); else tmp = y / (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e+83], N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 2.3e+151], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+83}:\\
\;\;\;\;\frac{z}{t} \cdot y\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+151}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if y < -1.25000000000000007e83Initial program 91.2%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -1.25000000000000007e83 < y < 2.3000000000000001e151Initial program 94.3%
Taylor expanded in x around inf 0
Simplified0
if 2.3000000000000001e151 < y Initial program 81.1%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ z t) y))) (if (<= y -190.0) t_1 (if (<= y 9.8e+150) x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z / t) * y;
double tmp;
if (y <= -190.0) {
tmp = t_1;
} else if (y <= 9.8e+150) {
tmp = x;
} 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 = (z / t) * y
if (y <= (-190.0d0)) then
tmp = t_1
else if (y <= 9.8d+150) then
tmp = x
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 = (z / t) * y;
double tmp;
if (y <= -190.0) {
tmp = t_1;
} else if (y <= 9.8e+150) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / t) * y tmp = 0 if y <= -190.0: tmp = t_1 elif y <= 9.8e+150: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / t) * y) tmp = 0.0 if (y <= -190.0) tmp = t_1; elseif (y <= 9.8e+150) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / t) * y; tmp = 0.0; if (y <= -190.0) tmp = t_1; elseif (y <= 9.8e+150) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -190.0], t$95$1, If[LessEqual[y, 9.8e+150], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{t} \cdot y\\
\mathbf{if}\;y \leq -190:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{+150}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -190 or 9.80000000000000014e150 < y Initial program 89.0%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -190 < y < 9.80000000000000014e150Initial program 94.3%
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= x -1e+207) (* x (- 1.0 (/ z t))) (+ x (* (/ (- y x) t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e+207) {
tmp = x * (1.0 - (z / t));
} 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 <= (-1d+207)) then
tmp = x * (1.0d0 - (z / t))
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 <= -1e+207) {
tmp = x * (1.0 - (z / t));
} else {
tmp = x + (((y - x) / t) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1e+207: tmp = x * (1.0 - (z / t)) else: tmp = x + (((y - x) / t) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1e+207) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = Float64(x + Float64(Float64(Float64(y - x) / t) * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1e+207) tmp = x * (1.0 - (z / t)); else tmp = x + (((y - x) / t) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1e+207], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+207}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\
\end{array}
\end{array}
if x < -1e207Initial program 92.3%
Taylor expanded in x around inf 0
Simplified0
if -1e207 < x Initial program 92.1%
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (+ (/ (- y x) (/ t z)) x))
double code(double x, double y, double z, double t) {
return ((y - x) / (t / z)) + 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 = ((y - x) / (t / z)) + x
end function
public static double code(double x, double y, double z, double t) {
return ((y - x) / (t / z)) + x;
}
def code(x, y, z, t): return ((y - x) / (t / z)) + x
function code(x, y, z, t) return Float64(Float64(Float64(y - x) / Float64(t / z)) + x) end
function tmp = code(x, y, z, t) tmp = ((y - x) / (t / z)) + x; end
code[x_, y_, z_, t_] := N[(N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y - x}{\frac{t}{z}} + x
\end{array}
Initial program 92.1%
Applied egg-rr0
(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.1%
Taylor expanded in z around 0 0
Simplified0
(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 2024110
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:alt
(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)))