
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= (* y (/ (- z t) (- a t))) 1e+295) (+ x (/ y (/ (- a t) (- z t)))) (+ x (/ (* y z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * ((z - t) / (a - t))) <= 1e+295) {
tmp = x + (y / ((a - t) / (z - t)));
} else {
tmp = x + ((y * z) / (a - 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 ((y * ((z - t) / (a - t))) <= 1d+295) then
tmp = x + (y / ((a - t) / (z - t)))
else
tmp = x + ((y * z) / (a - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * ((z - t) / (a - t))) <= 1e+295) {
tmp = x + (y / ((a - t) / (z - t)));
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y * ((z - t) / (a - t))) <= 1e+295: tmp = x + (y / ((a - t) / (z - t))) else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(y * Float64(Float64(z - t) / Float64(a - t))) <= 1e+295) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))); else tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y * ((z - t) / (a - t))) <= 1e+295) tmp = x + (y / ((a - t) / (z - t))); else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+295], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \frac{z - t}{a - t} \leq 10^{+295}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < 9.9999999999999998e294Initial program 99.5%
clear-num99.4%
un-div-inv99.6%
Applied egg-rr99.6%
if 9.9999999999999998e294 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 66.4%
Taylor expanded in z around inf 99.8%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7.8e+179)
(+ y x)
(if (<= t -3.5e+119)
(- x (* y (/ z t)))
(if (<= t -4.5e+86)
(+ y x)
(if (<= t -9.6e+41)
(+ x (/ y (/ a (- z t))))
(if (<= t 1.6e+134) (+ x (* z (/ y (- a t)))) (+ y x)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e+179) {
tmp = y + x;
} else if (t <= -3.5e+119) {
tmp = x - (y * (z / t));
} else if (t <= -4.5e+86) {
tmp = y + x;
} else if (t <= -9.6e+41) {
tmp = x + (y / (a / (z - t)));
} else if (t <= 1.6e+134) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = y + 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 (t <= (-7.8d+179)) then
tmp = y + x
else if (t <= (-3.5d+119)) then
tmp = x - (y * (z / t))
else if (t <= (-4.5d+86)) then
tmp = y + x
else if (t <= (-9.6d+41)) then
tmp = x + (y / (a / (z - t)))
else if (t <= 1.6d+134) then
tmp = x + (z * (y / (a - t)))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e+179) {
tmp = y + x;
} else if (t <= -3.5e+119) {
tmp = x - (y * (z / t));
} else if (t <= -4.5e+86) {
tmp = y + x;
} else if (t <= -9.6e+41) {
tmp = x + (y / (a / (z - t)));
} else if (t <= 1.6e+134) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.8e+179: tmp = y + x elif t <= -3.5e+119: tmp = x - (y * (z / t)) elif t <= -4.5e+86: tmp = y + x elif t <= -9.6e+41: tmp = x + (y / (a / (z - t))) elif t <= 1.6e+134: tmp = x + (z * (y / (a - t))) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.8e+179) tmp = Float64(y + x); elseif (t <= -3.5e+119) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= -4.5e+86) tmp = Float64(y + x); elseif (t <= -9.6e+41) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); elseif (t <= 1.6e+134) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.8e+179) tmp = y + x; elseif (t <= -3.5e+119) tmp = x - (y * (z / t)); elseif (t <= -4.5e+86) tmp = y + x; elseif (t <= -9.6e+41) tmp = x + (y / (a / (z - t))); elseif (t <= 1.6e+134) tmp = x + (z * (y / (a - t))); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.8e+179], N[(y + x), $MachinePrecision], If[LessEqual[t, -3.5e+119], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.5e+86], N[(y + x), $MachinePrecision], If[LessEqual[t, -9.6e+41], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e+134], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{+179}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{+119}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{+86}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -9.6 \cdot 10^{+41}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+134}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -7.79999999999999947e179 or -3.5000000000000001e119 < t < -4.49999999999999993e86 or 1.6e134 < t Initial program 99.9%
Taylor expanded in t around inf 84.4%
+-commutative84.4%
Simplified84.4%
if -7.79999999999999947e179 < t < -3.5000000000000001e119Initial program 100.0%
Taylor expanded in a around 0 60.2%
mul-1-neg60.2%
unsub-neg60.2%
associate-/l*75.9%
div-sub75.9%
sub-neg75.9%
*-inverses75.9%
metadata-eval75.9%
Simplified75.9%
Taylor expanded in z around inf 76.9%
associate-*r/86.1%
Simplified86.1%
if -4.49999999999999993e86 < t < -9.6000000000000007e41Initial program 99.9%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 77.8%
if -9.6000000000000007e41 < t < 1.6e134Initial program 96.1%
Taylor expanded in z around inf 85.9%
*-commutative85.9%
associate-/l*90.2%
Applied egg-rr90.2%
Final simplification87.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.8e+180)
(+ y x)
(if (<= t -9.5e+119)
(- x (* y (/ z t)))
(if (or (<= t -4.3e+86) (not (<= t 11500000000.0)))
(+ y x)
(+ x (* z (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.8e+180) {
tmp = y + x;
} else if (t <= -9.5e+119) {
tmp = x - (y * (z / t));
} else if ((t <= -4.3e+86) || !(t <= 11500000000.0)) {
tmp = y + x;
} else {
tmp = x + (z * (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 (t <= (-1.8d+180)) then
tmp = y + x
else if (t <= (-9.5d+119)) then
tmp = x - (y * (z / t))
else if ((t <= (-4.3d+86)) .or. (.not. (t <= 11500000000.0d0))) then
tmp = y + x
else
tmp = x + (z * (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 (t <= -1.8e+180) {
tmp = y + x;
} else if (t <= -9.5e+119) {
tmp = x - (y * (z / t));
} else if ((t <= -4.3e+86) || !(t <= 11500000000.0)) {
tmp = y + x;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.8e+180: tmp = y + x elif t <= -9.5e+119: tmp = x - (y * (z / t)) elif (t <= -4.3e+86) or not (t <= 11500000000.0): tmp = y + x else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.8e+180) tmp = Float64(y + x); elseif (t <= -9.5e+119) tmp = Float64(x - Float64(y * Float64(z / t))); elseif ((t <= -4.3e+86) || !(t <= 11500000000.0)) tmp = Float64(y + x); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.8e+180) tmp = y + x; elseif (t <= -9.5e+119) tmp = x - (y * (z / t)); elseif ((t <= -4.3e+86) || ~((t <= 11500000000.0))) tmp = y + x; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.8e+180], N[(y + x), $MachinePrecision], If[LessEqual[t, -9.5e+119], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -4.3e+86], N[Not[LessEqual[t, 11500000000.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+180}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{+119}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -4.3 \cdot 10^{+86} \lor \neg \left(t \leq 11500000000\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.8000000000000001e180 or -9.4999999999999994e119 < t < -4.3000000000000002e86 or 1.15e10 < t Initial program 99.9%
Taylor expanded in t around inf 79.0%
+-commutative79.0%
Simplified79.0%
if -1.8000000000000001e180 < t < -9.4999999999999994e119Initial program 100.0%
Taylor expanded in a around 0 60.2%
mul-1-neg60.2%
unsub-neg60.2%
associate-/l*75.9%
div-sub75.9%
sub-neg75.9%
*-inverses75.9%
metadata-eval75.9%
Simplified75.9%
Taylor expanded in z around inf 76.9%
associate-*r/86.1%
Simplified86.1%
if -4.3000000000000002e86 < t < 1.15e10Initial program 95.8%
Taylor expanded in t around 0 74.3%
*-commutative74.3%
associate-/l*77.0%
Applied egg-rr77.0%
Final simplification78.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (+ (/ z t) -1.0)))))
(if (<= t -4.2e+135)
t_1
(if (<= t -2.2e+55)
(- x (* y (/ t (- a t))))
(if (<= t 1.75e+137) (+ x (* z (/ y (- a t)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((z / t) + -1.0));
double tmp;
if (t <= -4.2e+135) {
tmp = t_1;
} else if (t <= -2.2e+55) {
tmp = x - (y * (t / (a - t)));
} else if (t <= 1.75e+137) {
tmp = x + (z * (y / (a - t)));
} 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 / t) + (-1.0d0)))
if (t <= (-4.2d+135)) then
tmp = t_1
else if (t <= (-2.2d+55)) then
tmp = x - (y * (t / (a - t)))
else if (t <= 1.75d+137) then
tmp = x + (z * (y / (a - t)))
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 / t) + -1.0));
double tmp;
if (t <= -4.2e+135) {
tmp = t_1;
} else if (t <= -2.2e+55) {
tmp = x - (y * (t / (a - t)));
} else if (t <= 1.75e+137) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((z / t) + -1.0)) tmp = 0 if t <= -4.2e+135: tmp = t_1 elif t <= -2.2e+55: tmp = x - (y * (t / (a - t))) elif t <= 1.75e+137: tmp = x + (z * (y / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))) tmp = 0.0 if (t <= -4.2e+135) tmp = t_1; elseif (t <= -2.2e+55) tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); elseif (t <= 1.75e+137) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * ((z / t) + -1.0)); tmp = 0.0; if (t <= -4.2e+135) tmp = t_1; elseif (t <= -2.2e+55) tmp = x - (y * (t / (a - t))); elseif (t <= 1.75e+137) tmp = x + (z * (y / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.2e+135], t$95$1, If[LessEqual[t, -2.2e+55], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+137], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{+55}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+137}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.20000000000000019e135 or 1.7500000000000001e137 < t Initial program 99.9%
Taylor expanded in a around 0 63.5%
mul-1-neg63.5%
unsub-neg63.5%
associate-/l*95.1%
div-sub95.1%
sub-neg95.1%
*-inverses95.1%
metadata-eval95.1%
Simplified95.1%
if -4.20000000000000019e135 < t < -2.2000000000000001e55Initial program 99.9%
Taylor expanded in z around 0 86.8%
mul-1-neg86.8%
unsub-neg86.8%
*-commutative86.8%
associate-/l*95.5%
Simplified95.5%
if -2.2000000000000001e55 < t < 1.7500000000000001e137Initial program 96.2%
Taylor expanded in z around inf 85.2%
*-commutative85.2%
associate-/l*89.4%
Applied egg-rr89.4%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- a t))))) (if (<= t_1 1e+295) (+ t_1 x) (+ x (/ (* y z) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= 1e+295) {
tmp = t_1 + x;
} else {
tmp = x + ((y * z) / (a - 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) :: t_1
real(8) :: tmp
t_1 = y * ((z - t) / (a - t))
if (t_1 <= 1d+295) then
tmp = t_1 + x
else
tmp = x + ((y * z) / (a - t))
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) / (a - t));
double tmp;
if (t_1 <= 1e+295) {
tmp = t_1 + x;
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (a - t)) tmp = 0 if t_1 <= 1e+295: tmp = t_1 + x else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t_1 <= 1e+295) tmp = Float64(t_1 + x); else tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (a - t)); tmp = 0.0; if (t_1 <= 1e+295) tmp = t_1 + x; else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+295], N[(t$95$1 + x), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t\_1 \leq 10^{+295}:\\
\;\;\;\;t\_1 + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < 9.9999999999999998e294Initial program 99.5%
if 9.9999999999999998e294 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 66.4%
Taylor expanded in z around inf 99.8%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- a t))))) (if (<= t_1 2e+220) (+ t_1 x) (- x (* (- z t) (/ y (- t a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= 2e+220) {
tmp = t_1 + x;
} else {
tmp = x - ((z - t) * (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) :: t_1
real(8) :: tmp
t_1 = y * ((z - t) / (a - t))
if (t_1 <= 2d+220) then
tmp = t_1 + x
else
tmp = x - ((z - t) * (y / (t - a)))
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) / (a - t));
double tmp;
if (t_1 <= 2e+220) {
tmp = t_1 + x;
} else {
tmp = x - ((z - t) * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (a - t)) tmp = 0 if t_1 <= 2e+220: tmp = t_1 + x else: tmp = x - ((z - t) * (y / (t - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t_1 <= 2e+220) tmp = Float64(t_1 + x); else tmp = Float64(x - Float64(Float64(z - t) * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (a - t)); tmp = 0.0; if (t_1 <= 2e+220) tmp = t_1 + x; else tmp = x - ((z - t) * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+220], N[(t$95$1 + x), $MachinePrecision], N[(x - N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+220}:\\
\;\;\;\;t\_1 + x\\
\mathbf{else}:\\
\;\;\;\;x - \left(z - t\right) \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < 2e220Initial program 99.5%
if 2e220 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 82.5%
associate-*r/69.0%
Simplified69.0%
*-commutative69.0%
associate-/l*99.8%
Applied egg-rr99.8%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7e+179) (not (<= t 4.6e+133))) (+ y x) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7e+179) || !(t <= 4.6e+133)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - 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 ((t <= (-7d+179)) .or. (.not. (t <= 4.6d+133))) then
tmp = y + x
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7e+179) || !(t <= 4.6e+133)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7e+179) or not (t <= 4.6e+133): tmp = y + x else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7e+179) || !(t <= 4.6e+133)) tmp = Float64(y + x); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7e+179) || ~((t <= 4.6e+133))) tmp = y + x; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7e+179], N[Not[LessEqual[t, 4.6e+133]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+179} \lor \neg \left(t \leq 4.6 \cdot 10^{+133}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -7.0000000000000003e179 or 4.5999999999999998e133 < t Initial program 99.9%
Taylor expanded in t around inf 85.0%
+-commutative85.0%
Simplified85.0%
if -7.0000000000000003e179 < t < 4.5999999999999998e133Initial program 96.8%
Taylor expanded in z around inf 81.9%
*-commutative81.9%
associate-/l*86.0%
Applied egg-rr86.0%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.5e+86) (not (<= t 7e+135))) (- x (* y (+ (/ z t) -1.0))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.5e+86) || !(t <= 7e+135)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x + (z * (y / (a - 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 ((t <= (-4.5d+86)) .or. (.not. (t <= 7d+135))) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.5e+86) || !(t <= 7e+135)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.5e+86) or not (t <= 7e+135): tmp = x - (y * ((z / t) + -1.0)) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.5e+86) || !(t <= 7e+135)) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.5e+86) || ~((t <= 7e+135))) tmp = x - (y * ((z / t) + -1.0)); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.5e+86], N[Not[LessEqual[t, 7e+135]], $MachinePrecision]], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+86} \lor \neg \left(t \leq 7 \cdot 10^{+135}\right):\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -4.49999999999999993e86 or 7.0000000000000005e135 < t Initial program 99.9%
Taylor expanded in a around 0 64.8%
mul-1-neg64.8%
unsub-neg64.8%
associate-/l*91.6%
div-sub91.6%
sub-neg91.6%
*-inverses91.6%
metadata-eval91.6%
Simplified91.6%
if -4.49999999999999993e86 < t < 7.0000000000000005e135Initial program 96.4%
Taylor expanded in z around inf 84.8%
*-commutative84.8%
associate-/l*88.7%
Applied egg-rr88.7%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.5e+86) (not (<= t 300000000000.0))) (+ y x) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.5e+86) || !(t <= 300000000000.0)) {
tmp = y + x;
} else {
tmp = x + (z * (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 ((t <= (-8.5d+86)) .or. (.not. (t <= 300000000000.0d0))) then
tmp = y + x
else
tmp = x + (z * (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 ((t <= -8.5e+86) || !(t <= 300000000000.0)) {
tmp = y + x;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.5e+86) or not (t <= 300000000000.0): tmp = y + x else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.5e+86) || !(t <= 300000000000.0)) tmp = Float64(y + x); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -8.5e+86) || ~((t <= 300000000000.0))) tmp = y + x; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.5e+86], N[Not[LessEqual[t, 300000000000.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+86} \lor \neg \left(t \leq 300000000000\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -8.5000000000000005e86 or 3e11 < t Initial program 99.9%
Taylor expanded in t around inf 75.6%
+-commutative75.6%
Simplified75.6%
if -8.5000000000000005e86 < t < 3e11Initial program 95.8%
Taylor expanded in t around 0 74.3%
*-commutative74.3%
associate-/l*77.0%
Applied egg-rr77.0%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -8e+183) x (if (<= a 3.2e+135) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8e+183) {
tmp = x;
} else if (a <= 3.2e+135) {
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 (a <= (-8d+183)) then
tmp = x
else if (a <= 3.2d+135) 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 (a <= -8e+183) {
tmp = x;
} else if (a <= 3.2e+135) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8e+183: tmp = x elif a <= 3.2e+135: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8e+183) tmp = x; elseif (a <= 3.2e+135) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8e+183) tmp = x; elseif (a <= 3.2e+135) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8e+183], x, If[LessEqual[a, 3.2e+135], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{+183}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+135}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -7.99999999999999957e183 or 3.19999999999999975e135 < a Initial program 99.9%
Taylor expanded in x around inf 71.8%
if -7.99999999999999957e183 < a < 3.19999999999999975e135Initial program 96.7%
Taylor expanded in t around inf 63.2%
+-commutative63.2%
Simplified63.2%
Final simplification65.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 97.7%
Taylor expanded in x around inf 49.4%
Final simplification49.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} 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 - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
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 - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024079
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))