
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+299)))
(+ x (* (/ y (- a z)) (- t z)))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+299)) {
tmp = x + ((y / (a - z)) * (t - z));
} else {
tmp = x + t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+299)) {
tmp = x + ((y / (a - z)) * (t - z));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+299): tmp = x + ((y / (a - z)) * (t - z)) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+299)) tmp = Float64(x + Float64(Float64(y / Float64(a - z)) * Float64(t - z))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+299))) tmp = x + ((y / (a - z)) * (t - z)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+299]], $MachinePrecision]], N[(x + N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+299}\right):\\
\;\;\;\;x + \frac{y}{a - z} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 2.0000000000000001e299 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 46.7%
+-commutative46.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
fma-undefine99.9%
associate-/l*46.7%
div-inv46.7%
*-commutative46.7%
associate-*r*99.8%
div-inv99.9%
Applied egg-rr99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e299Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 85.6%
+-commutative85.6%
associate-/l*99.0%
fma-define99.0%
Simplified99.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 -5e+267) (not (<= t_1 2e+299)))
(- x (/ (- z t) (/ (- a z) y)))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -5e+267) || !(t_1 <= 2e+299)) {
tmp = x - ((z - t) / ((a - z) / y));
} else {
tmp = x + 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 = (y * (z - t)) / (z - a)
if ((t_1 <= (-5d+267)) .or. (.not. (t_1 <= 2d+299))) then
tmp = x - ((z - t) / ((a - z) / y))
else
tmp = x + 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 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -5e+267) || !(t_1 <= 2e+299)) {
tmp = x - ((z - t) / ((a - z) / y));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -5e+267) or not (t_1 <= 2e+299): tmp = x - ((z - t) / ((a - z) / y)) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= -5e+267) || !(t_1 <= 2e+299)) tmp = Float64(x - Float64(Float64(z - t) / Float64(Float64(a - z) / y))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -5e+267) || ~((t_1 <= 2e+299))) tmp = x - ((z - t) / ((a - z) / y)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+267], N[Not[LessEqual[t$95$1, 2e+299]], $MachinePrecision]], N[(x - N[(N[(z - t), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+267} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+299}\right):\\
\;\;\;\;x - \frac{z - t}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -4.9999999999999999e267 or 2.0000000000000001e299 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 47.4%
clear-num47.5%
inv-pow47.5%
Applied egg-rr47.5%
unpow-147.5%
associate-/r*99.8%
Simplified99.8%
clear-num99.8%
add-cube-cbrt98.9%
*-un-lft-identity98.9%
times-frac98.9%
pow298.9%
Applied egg-rr98.9%
/-rgt-identity98.9%
associate-*r/98.9%
unpow298.9%
rem-3cbrt-lft99.8%
Simplified99.8%
if -4.9999999999999999e267 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e299Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (<= t_1 (- INFINITY))
(+ x (* y (/ (- z t) z)))
(if (<= t_1 2e+299) (+ x t_1) (+ x (* t (/ y (- a z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + (y * ((z - t) / z));
} else if (t_1 <= 2e+299) {
tmp = x + t_1;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + (y * ((z - t) / z));
} else if (t_1 <= 2e+299) {
tmp = x + t_1;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if t_1 <= -math.inf: tmp = x + (y * ((z - t) / z)) elif t_1 <= 2e+299: tmp = x + t_1 else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (t_1 <= 2e+299) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if (t_1 <= -Inf) tmp = x + (y * ((z - t) / z)); elseif (t_1 <= 2e+299) tmp = x + t_1; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+299], N[(x + t$95$1), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 41.6%
+-commutative41.6%
associate-/l*100.0%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 35.7%
+-commutative35.7%
associate-/l*81.6%
Simplified81.6%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e299Initial program 99.4%
if 2.0000000000000001e299 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 52.9%
Taylor expanded in t around inf 52.4%
mul-1-neg52.4%
associate-/l*74.3%
distribute-rgt-neg-in74.3%
distribute-frac-neg274.3%
Simplified74.3%
Taylor expanded in x around 0 52.4%
associate-/l*74.3%
sub-neg74.3%
+-commutative74.3%
neg-sub074.3%
associate--r-74.3%
sub0-neg74.3%
distribute-neg-frac274.3%
distribute-rgt-neg-in74.3%
sub-neg74.3%
Simplified74.3%
Final simplification93.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.1e-58) (not (<= t 3.6e+103))) (+ x (* t (/ y (- a z)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.1e-58) || !(t <= 3.6e+103)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - 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 ((t <= (-6.1d-58)) .or. (.not. (t <= 3.6d+103))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.1e-58) || !(t <= 3.6e+103)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.1e-58) or not (t <= 3.6e+103): tmp = x + (t * (y / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.1e-58) || !(t <= 3.6e+103)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.1e-58) || ~((t <= 3.6e+103))) tmp = x + (t * (y / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.1e-58], N[Not[LessEqual[t, 3.6e+103]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.1 \cdot 10^{-58} \lor \neg \left(t \leq 3.6 \cdot 10^{+103}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -6.1000000000000003e-58 or 3.60000000000000017e103 < t Initial program 84.1%
Taylor expanded in t around inf 82.8%
mul-1-neg82.8%
associate-/l*90.3%
distribute-rgt-neg-in90.3%
distribute-frac-neg290.3%
Simplified90.3%
Taylor expanded in x around 0 82.8%
associate-/l*90.3%
sub-neg90.3%
+-commutative90.3%
neg-sub090.3%
associate--r-90.3%
sub0-neg90.3%
distribute-neg-frac290.3%
distribute-rgt-neg-in90.3%
sub-neg90.3%
Simplified90.3%
if -6.1000000000000003e-58 < t < 3.60000000000000017e103Initial program 86.9%
Taylor expanded in t around 0 79.3%
associate-/l*91.0%
Simplified91.0%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -17500000000000.0) (not (<= z 1.6e-153))) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -17500000000000.0) || !(z <= 1.6e-153)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / 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 <= (-17500000000000.0d0)) .or. (.not. (z <= 1.6d-153))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (y * (t / 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 <= -17500000000000.0) || !(z <= 1.6e-153)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -17500000000000.0) or not (z <= 1.6e-153): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -17500000000000.0) || !(z <= 1.6e-153)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -17500000000000.0) || ~((z <= 1.6e-153))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -17500000000000.0], N[Not[LessEqual[z, 1.6e-153]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -17500000000000 \lor \neg \left(z \leq 1.6 \cdot 10^{-153}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.75e13 or 1.6e-153 < z Initial program 79.5%
+-commutative79.5%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 66.6%
+-commutative66.6%
associate-/l*81.7%
Simplified81.7%
if -1.75e13 < z < 1.6e-153Initial program 95.2%
+-commutative95.2%
associate-/l*97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in z around 0 78.1%
+-commutative78.1%
associate-/l*80.1%
Simplified80.1%
clear-num80.0%
inv-pow80.0%
Applied egg-rr80.0%
unpow-180.0%
Simplified80.0%
un-div-inv80.0%
Applied egg-rr80.0%
associate-/r/81.6%
Simplified81.6%
Final simplification81.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -320000000000.0) (+ x (* y (/ (- z t) z))) (if (<= z 1.6e-153) (+ x (* y (/ t a))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -320000000000.0) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.6e-153) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y / (z / (z - t)));
}
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 <= (-320000000000.0d0)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 1.6d-153) then
tmp = x + (y * (t / a))
else
tmp = x + (y / (z / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -320000000000.0) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.6e-153) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -320000000000.0: tmp = x + (y * ((z - t) / z)) elif z <= 1.6e-153: tmp = x + (y * (t / a)) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -320000000000.0) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 1.6e-153) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -320000000000.0) tmp = x + (y * ((z - t) / z)); elseif (z <= 1.6e-153) tmp = x + (y * (t / a)); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -320000000000.0], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e-153], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -320000000000:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-153}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -3.2e11Initial program 79.2%
+-commutative79.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 70.6%
+-commutative70.6%
associate-/l*86.8%
Simplified86.8%
if -3.2e11 < z < 1.6e-153Initial program 95.2%
+-commutative95.2%
associate-/l*97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in z around 0 78.1%
+-commutative78.1%
associate-/l*80.1%
Simplified80.1%
clear-num80.0%
inv-pow80.0%
Applied egg-rr80.0%
unpow-180.0%
Simplified80.0%
un-div-inv80.0%
Applied egg-rr80.0%
associate-/r/81.6%
Simplified81.6%
if 1.6e-153 < z Initial program 79.6%
+-commutative79.6%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 63.9%
+-commutative63.9%
associate-/l*78.2%
Simplified78.2%
clear-num78.2%
un-div-inv78.2%
Applied egg-rr78.2%
Final simplification81.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.65e+67) (+ x (* y (/ t a))) (if (<= t 1.2e+162) (+ x (* y (/ z (- z a)))) (- x (/ t (/ z y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.65e+67) {
tmp = x + (y * (t / a));
} else if (t <= 1.2e+162) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (t / (z / y));
}
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 (t <= (-1.65d+67)) then
tmp = x + (y * (t / a))
else if (t <= 1.2d+162) then
tmp = x + (y * (z / (z - a)))
else
tmp = x - (t / (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.65e+67) {
tmp = x + (y * (t / a));
} else if (t <= 1.2e+162) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (t / (z / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.65e+67: tmp = x + (y * (t / a)) elif t <= 1.2e+162: tmp = x + (y * (z / (z - a))) else: tmp = x - (t / (z / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.65e+67) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t <= 1.2e+162) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(t / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.65e+67) tmp = x + (y * (t / a)); elseif (t <= 1.2e+162) tmp = x + (y * (z / (z - a))); else tmp = x - (t / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.65e+67], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+162], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+67}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+162}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -1.6500000000000001e67Initial program 74.1%
+-commutative74.1%
associate-/l*99.8%
fma-define99.7%
Simplified99.7%
Taylor expanded in z around 0 46.7%
+-commutative46.7%
associate-/l*58.4%
Simplified58.4%
clear-num58.4%
inv-pow58.4%
Applied egg-rr58.4%
unpow-158.4%
Simplified58.4%
un-div-inv58.4%
Applied egg-rr58.4%
associate-/r/60.6%
Simplified60.6%
if -1.6500000000000001e67 < t < 1.20000000000000005e162Initial program 87.7%
Taylor expanded in t around 0 75.2%
associate-/l*86.4%
Simplified86.4%
if 1.20000000000000005e162 < t Initial program 90.9%
Taylor expanded in t around inf 90.6%
mul-1-neg90.6%
associate-/l*96.8%
distribute-rgt-neg-in96.8%
distribute-frac-neg296.8%
Simplified96.8%
Taylor expanded in z around inf 68.0%
mul-1-neg68.0%
unsub-neg68.0%
associate-/l*71.2%
Simplified71.2%
clear-num71.3%
un-div-inv71.4%
Applied egg-rr71.4%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e+62) (not (<= z 1.8e+32))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e+62) || !(z <= 1.8e+32)) {
tmp = y + x;
} else {
tmp = x + (y * (t / 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 <= (-2.1d+62)) .or. (.not. (z <= 1.8d+32))) then
tmp = y + x
else
tmp = x + (y * (t / 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 <= -2.1e+62) || !(z <= 1.8e+32)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e+62) or not (z <= 1.8e+32): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e+62) || !(z <= 1.8e+32)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.1e+62) || ~((z <= 1.8e+32))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e+62], N[Not[LessEqual[z, 1.8e+32]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+62} \lor \neg \left(z \leq 1.8 \cdot 10^{+32}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.1e62 or 1.7999999999999998e32 < z Initial program 70.8%
+-commutative70.8%
associate-/l*100.0%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 77.1%
+-commutative77.1%
Simplified77.1%
if -2.1e62 < z < 1.7999999999999998e32Initial program 95.0%
+-commutative95.0%
associate-/l*98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in z around 0 69.6%
+-commutative69.6%
associate-/l*71.4%
Simplified71.4%
clear-num71.4%
inv-pow71.4%
Applied egg-rr71.4%
unpow-171.4%
Simplified71.4%
un-div-inv71.4%
Applied egg-rr71.4%
associate-/r/73.6%
Simplified73.6%
Final simplification75.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.05e+65) (not (<= z 5.5e+14))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.05e+65) || !(z <= 5.5e+14)) {
tmp = y + 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 <= (-2.05d+65)) .or. (.not. (z <= 5.5d+14))) then
tmp = y + 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 <= -2.05e+65) || !(z <= 5.5e+14)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.05e+65) or not (z <= 5.5e+14): tmp = y + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.05e+65) || !(z <= 5.5e+14)) tmp = Float64(y + 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 <= -2.05e+65) || ~((z <= 5.5e+14))) tmp = y + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.05e+65], N[Not[LessEqual[z, 5.5e+14]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+65} \lor \neg \left(z \leq 5.5 \cdot 10^{+14}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.0500000000000001e65 or 5.5e14 < z Initial program 70.8%
+-commutative70.8%
associate-/l*100.0%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 77.1%
+-commutative77.1%
Simplified77.1%
if -2.0500000000000001e65 < z < 5.5e14Initial program 95.0%
+-commutative95.0%
associate-/l*98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in z around 0 69.6%
+-commutative69.6%
associate-/l*71.4%
Simplified71.4%
Final simplification73.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.6e+56) (not (<= z 1.3e-119))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.6e+56) || !(z <= 1.3e-119)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / 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 <= (-7.6d+56)) .or. (.not. (z <= 1.3d-119))) then
tmp = y + x
else
tmp = x + ((y * t) / 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 <= -7.6e+56) || !(z <= 1.3e-119)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.6e+56) or not (z <= 1.3e-119): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.6e+56) || !(z <= 1.3e-119)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.6e+56) || ~((z <= 1.3e-119))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.6e+56], N[Not[LessEqual[z, 1.3e-119]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+56} \lor \neg \left(z \leq 1.3 \cdot 10^{-119}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -7.59999999999999991e56 or 1.30000000000000006e-119 < z Initial program 76.6%
+-commutative76.6%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 69.2%
+-commutative69.2%
Simplified69.2%
if -7.59999999999999991e56 < z < 1.30000000000000006e-119Initial program 95.9%
Taylor expanded in z around 0 76.5%
Final simplification72.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e-88) (not (<= z 3.2e-124))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e-88) || !(z <= 3.2e-124)) {
tmp = y + x;
} else {
tmp = 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 ((z <= (-7.2d-88)) .or. (.not. (z <= 3.2d-124))) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e-88) || !(z <= 3.2e-124)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e-88) or not (z <= 3.2e-124): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e-88) || !(z <= 3.2e-124)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.2e-88) || ~((z <= 3.2e-124))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e-88], N[Not[LessEqual[z, 3.2e-124]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-88} \lor \neg \left(z \leq 3.2 \cdot 10^{-124}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.1999999999999999e-88 or 3.20000000000000004e-124 < z Initial program 80.5%
+-commutative80.5%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 66.7%
+-commutative66.7%
Simplified66.7%
if -7.1999999999999999e-88 < z < 3.20000000000000004e-124Initial program 95.5%
+-commutative95.5%
associate-/l*97.3%
fma-define97.3%
Simplified97.3%
Taylor expanded in y around 0 55.4%
Final simplification62.9%
(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 85.6%
+-commutative85.6%
associate-/l*99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in y around 0 49.5%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024163
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))