
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (<= t_1 (- INFINITY))
(+ x (/ (- y z) (/ (- a z) t)))
(if (<= t_1 2e+266) (+ t_1 x) (+ x (* (- y z) (/ t (- a z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + ((y - z) / ((a - z) / t));
} else if (t_1 <= 2e+266) {
tmp = t_1 + x;
} else {
tmp = x + ((y - z) * (t / (a - z)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((y - z) / ((a - z) / t));
} else if (t_1 <= 2e+266) {
tmp = t_1 + x;
} else {
tmp = x + ((y - z) * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if t_1 <= -math.inf: tmp = x + ((y - z) / ((a - z) / t)) elif t_1 <= 2e+266: tmp = t_1 + x else: tmp = x + ((y - z) * (t / (a - z))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / t))); elseif (t_1 <= 2e+266) tmp = Float64(t_1 + x); else tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((y - z) / ((a - z) / t)); elseif (t_1 <= 2e+266) tmp = t_1 + x; else tmp = x + ((y - z) * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+266], N[(t$95$1 + x), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+266}:\\
\;\;\;\;t\_1 + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0Initial program 48.5%
associate-/l*99.8%
Simplified99.8%
clear-num99.6%
un-div-inv99.9%
Applied egg-rr99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2.0000000000000001e266Initial program 99.7%
if 2.0000000000000001e266 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 41.9%
associate-/l*99.9%
Simplified99.9%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+266)))
(+ x (* (- y z) (/ t (- a z))))
(+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+266)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t_1 + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+266)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+266): tmp = x + ((y - z) * (t / (a - z))) else: tmp = t_1 + x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+266)) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = Float64(t_1 + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+266))) tmp = x + ((y - z) * (t / (a - z))); else tmp = t_1 + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+266]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+266}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 2.0000000000000001e266 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 45.8%
associate-/l*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2.0000000000000001e266Initial program 99.7%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.5e+86)
(+ t x)
(if (<= z -6.5e+34)
(- x (* t (/ y z)))
(if (or (<= z -3.05e-9) (not (<= z 5.6e-11)))
(+ t x)
(+ x (* t (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+86) {
tmp = t + x;
} else if (z <= -6.5e+34) {
tmp = x - (t * (y / z));
} else if ((z <= -3.05e-9) || !(z <= 5.6e-11)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.5d+86)) then
tmp = t + x
else if (z <= (-6.5d+34)) then
tmp = x - (t * (y / z))
else if ((z <= (-3.05d-9)) .or. (.not. (z <= 5.6d-11))) then
tmp = t + x
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+86) {
tmp = t + x;
} else if (z <= -6.5e+34) {
tmp = x - (t * (y / z));
} else if ((z <= -3.05e-9) || !(z <= 5.6e-11)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e+86: tmp = t + x elif z <= -6.5e+34: tmp = x - (t * (y / z)) elif (z <= -3.05e-9) or not (z <= 5.6e-11): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e+86) tmp = Float64(t + x); elseif (z <= -6.5e+34) tmp = Float64(x - Float64(t * Float64(y / z))); elseif ((z <= -3.05e-9) || !(z <= 5.6e-11)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e+86) tmp = t + x; elseif (z <= -6.5e+34) tmp = x - (t * (y / z)); elseif ((z <= -3.05e-9) || ~((z <= 5.6e-11))) tmp = t + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+86], N[(t + x), $MachinePrecision], If[LessEqual[z, -6.5e+34], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -3.05e-9], N[Not[LessEqual[z, 5.6e-11]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+86}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{+34}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -3.05 \cdot 10^{-9} \lor \neg \left(z \leq 5.6 \cdot 10^{-11}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.50000000000000019e86 or -6.50000000000000017e34 < z < -3.05e-9 or 5.6e-11 < z Initial program 80.3%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around inf 81.4%
if -3.50000000000000019e86 < z < -6.50000000000000017e34Initial program 90.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 74.5%
associate-*r/74.5%
associate-*r*74.5%
neg-mul-174.5%
*-commutative74.5%
associate-/l*74.5%
Simplified74.5%
Taylor expanded in x around 0 74.5%
mul-1-neg74.5%
associate-/l*74.7%
distribute-lft-neg-in74.7%
cancel-sign-sub-inv74.7%
div-sub74.7%
sub-neg74.7%
*-inverses74.7%
metadata-eval74.7%
Simplified74.7%
Taylor expanded in y around inf 69.9%
associate-*r/70.1%
Simplified70.1%
if -3.05e-9 < z < 5.6e-11Initial program 95.5%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in z around 0 79.7%
associate-/l*81.6%
Simplified81.6%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e+97) (not (<= z 1.08e+111))) (+ t x) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e+97) || !(z <= 1.08e+111)) {
tmp = t + x;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.5d+97)) .or. (.not. (z <= 1.08d+111))) then
tmp = t + x
else
tmp = x + (t * (y / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e+97) || !(z <= 1.08e+111)) {
tmp = t + x;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e+97) or not (z <= 1.08e+111): tmp = t + x else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e+97) || !(z <= 1.08e+111)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.5e+97) || ~((z <= 1.08e+111))) tmp = t + x; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e+97], N[Not[LessEqual[z, 1.08e+111]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+97} \lor \neg \left(z \leq 1.08 \cdot 10^{+111}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.4999999999999999e97 or 1.08000000000000004e111 < z Initial program 73.7%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around inf 85.8%
if -1.4999999999999999e97 < z < 1.08000000000000004e111Initial program 93.9%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in y around inf 82.6%
associate-/l*85.0%
Simplified85.0%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.9e+95) (not (<= z 0.00175))) (- x (* t (+ (/ y z) -1.0))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.9e+95) || !(z <= 0.00175)) {
tmp = x - (t * ((y / z) + -1.0));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.9d+95)) .or. (.not. (z <= 0.00175d0))) then
tmp = x - (t * ((y / z) + (-1.0d0)))
else
tmp = x + (t * (y / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.9e+95) || !(z <= 0.00175)) {
tmp = x - (t * ((y / z) + -1.0));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.9e+95) or not (z <= 0.00175): tmp = x - (t * ((y / z) + -1.0)) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.9e+95) || !(z <= 0.00175)) tmp = Float64(x - Float64(t * Float64(Float64(y / z) + -1.0))); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.9e+95) || ~((z <= 0.00175))) tmp = x - (t * ((y / z) + -1.0)); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.9e+95], N[Not[LessEqual[z, 0.00175]], $MachinePrecision]], N[(x - N[(t * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{+95} \lor \neg \left(z \leq 0.00175\right):\\
\;\;\;\;x - t \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -4.8999999999999999e95 or 0.00175000000000000004 < z Initial program 79.2%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in a around 0 70.2%
associate-*r/70.2%
associate-*r*70.2%
neg-mul-170.2%
*-commutative70.2%
associate-/l*86.1%
Simplified86.1%
Taylor expanded in x around 0 70.2%
mul-1-neg70.2%
associate-/l*90.1%
distribute-lft-neg-in90.1%
cancel-sign-sub-inv90.1%
div-sub90.1%
sub-neg90.1%
*-inverses90.1%
metadata-eval90.1%
Simplified90.1%
if -4.8999999999999999e95 < z < 0.00175000000000000004Initial program 94.0%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in y around inf 84.4%
associate-/l*87.3%
Simplified87.3%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.6e-9) (not (<= z 5.2e-12))) (+ t x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.6e-9) || !(z <= 5.2e-12)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-8.6d-9)) .or. (.not. (z <= 5.2d-12))) then
tmp = t + x
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.6e-9) || !(z <= 5.2e-12)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.6e-9) or not (z <= 5.2e-12): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.6e-9) || !(z <= 5.2e-12)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.6e-9) || ~((z <= 5.2e-12))) tmp = t + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.6e-9], N[Not[LessEqual[z, 5.2e-12]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{-9} \lor \neg \left(z \leq 5.2 \cdot 10^{-12}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -8.59999999999999925e-9 or 5.19999999999999965e-12 < z Initial program 81.7%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around inf 76.5%
if -8.59999999999999925e-9 < z < 5.19999999999999965e-12Initial program 95.5%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in z around 0 79.7%
associate-/l*81.6%
Simplified81.6%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.8e-230) (not (<= z 1.3e-192))) (+ t x) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e-230) || !(z <= 1.3e-192)) {
tmp = t + x;
} else {
tmp = t * (y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.8d-230)) .or. (.not. (z <= 1.3d-192))) then
tmp = t + x
else
tmp = t * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e-230) || !(z <= 1.3e-192)) {
tmp = t + x;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.8e-230) or not (z <= 1.3e-192): tmp = t + x else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.8e-230) || !(z <= 1.3e-192)) tmp = Float64(t + x); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.8e-230) || ~((z <= 1.3e-192))) tmp = t + x; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.8e-230], N[Not[LessEqual[z, 1.3e-192]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-230} \lor \neg \left(z \leq 1.3 \cdot 10^{-192}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.7999999999999998e-230 or 1.3000000000000001e-192 < z Initial program 87.0%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 70.3%
if -3.7999999999999998e-230 < z < 1.3000000000000001e-192Initial program 92.6%
associate-/l*84.0%
Simplified84.0%
Taylor expanded in a around inf 88.9%
*-commutative88.9%
associate-/l*79.8%
Simplified79.8%
Taylor expanded in t around inf 54.5%
Taylor expanded in y around inf 52.1%
Final simplification67.3%
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ t (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * (t / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * (t / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * (t / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Initial program 87.9%
associate-/l*95.3%
Simplified95.3%
Final simplification95.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -6e+71) x (+ t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6e+71) {
tmp = x;
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-6d+71)) then
tmp = x
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6e+71) {
tmp = x;
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6e+71: tmp = x else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6e+71) tmp = x; else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6e+71) tmp = x; else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6e+71], x, N[(t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+71}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if a < -6.00000000000000025e71Initial program 82.5%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in z around 0 75.1%
Taylor expanded in x around inf 73.8%
if -6.00000000000000025e71 < a Initial program 88.9%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in z around inf 65.5%
Final simplification66.7%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 87.9%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around 0 63.1%
Taylor expanded in x around inf 55.4%
Final simplification55.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024130
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))