
(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 14 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 (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 84.9%
+-commutative84.9%
associate-*r/98.3%
fma-def98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.3e+55)
(+ y x)
(if (<= z 1.55e-112)
(+ x (* y (/ t a)))
(if (<= z 2.5e-93)
(- x (/ (* y z) a))
(if (<= z 4.6e+74) (+ x (/ y (/ a t))) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+55) {
tmp = y + x;
} else if (z <= 1.55e-112) {
tmp = x + (y * (t / a));
} else if (z <= 2.5e-93) {
tmp = x - ((y * z) / a);
} else if (z <= 4.6e+74) {
tmp = x + (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 (z <= (-1.3d+55)) then
tmp = y + x
else if (z <= 1.55d-112) then
tmp = x + (y * (t / a))
else if (z <= 2.5d-93) then
tmp = x - ((y * z) / a)
else if (z <= 4.6d+74) then
tmp = x + (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 (z <= -1.3e+55) {
tmp = y + x;
} else if (z <= 1.55e-112) {
tmp = x + (y * (t / a));
} else if (z <= 2.5e-93) {
tmp = x - ((y * z) / a);
} else if (z <= 4.6e+74) {
tmp = x + (y / (a / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+55: tmp = y + x elif z <= 1.55e-112: tmp = x + (y * (t / a)) elif z <= 2.5e-93: tmp = x - ((y * z) / a) elif z <= 4.6e+74: tmp = x + (y / (a / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+55) tmp = Float64(y + x); elseif (z <= 1.55e-112) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 2.5e-93) tmp = Float64(x - Float64(Float64(y * z) / a)); elseif (z <= 4.6e+74) tmp = Float64(x + 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 (z <= -1.3e+55) tmp = y + x; elseif (z <= 1.55e-112) tmp = x + (y * (t / a)); elseif (z <= 2.5e-93) tmp = x - ((y * z) / a); elseif (z <= 4.6e+74) tmp = x + (y / (a / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+55], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.55e-112], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-93], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+74], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+55}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-112}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-93}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+74}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.3e55 or 4.5999999999999997e74 < z Initial program 73.0%
+-commutative73.0%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around inf 82.2%
if -1.3e55 < z < 1.5499999999999999e-112Initial program 92.6%
+-commutative92.6%
associate-*r/97.4%
fma-def97.4%
Simplified97.4%
Taylor expanded in z around 0 77.1%
*-commutative77.1%
associate-/l*81.1%
associate-/r/81.9%
Applied egg-rr81.9%
if 1.5499999999999999e-112 < z < 2.49999999999999997e-93Initial program 99.8%
+-commutative99.8%
associate-*r/87.6%
fma-def87.6%
Simplified87.6%
Taylor expanded in a around inf 68.4%
+-commutative68.4%
*-commutative68.4%
mul-1-neg68.4%
unsub-neg68.4%
*-commutative68.4%
associate-/l*59.8%
Simplified59.8%
Taylor expanded in z around inf 89.8%
if 2.49999999999999997e-93 < z < 4.5999999999999997e74Initial program 91.0%
+-commutative91.0%
associate-*r/99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in z around 0 68.2%
associate-/l*71.1%
Simplified71.1%
Final simplification80.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (/ a t))))
(if (<= t -4e+190)
t_1
(if (<= t -4.8e-122)
(+ y x)
(if (<= t -4.15e-286) x (if (<= t 6.2e+195) (+ y x) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a / t);
double tmp;
if (t <= -4e+190) {
tmp = t_1;
} else if (t <= -4.8e-122) {
tmp = y + x;
} else if (t <= -4.15e-286) {
tmp = x;
} else if (t <= 6.2e+195) {
tmp = y + x;
} 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 = y / (a / t)
if (t <= (-4d+190)) then
tmp = t_1
else if (t <= (-4.8d-122)) then
tmp = y + x
else if (t <= (-4.15d-286)) then
tmp = x
else if (t <= 6.2d+195) then
tmp = y + x
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 = y / (a / t);
double tmp;
if (t <= -4e+190) {
tmp = t_1;
} else if (t <= -4.8e-122) {
tmp = y + x;
} else if (t <= -4.15e-286) {
tmp = x;
} else if (t <= 6.2e+195) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a / t) tmp = 0 if t <= -4e+190: tmp = t_1 elif t <= -4.8e-122: tmp = y + x elif t <= -4.15e-286: tmp = x elif t <= 6.2e+195: tmp = y + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a / t)) tmp = 0.0 if (t <= -4e+190) tmp = t_1; elseif (t <= -4.8e-122) tmp = Float64(y + x); elseif (t <= -4.15e-286) tmp = x; elseif (t <= 6.2e+195) tmp = Float64(y + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a / t); tmp = 0.0; if (t <= -4e+190) tmp = t_1; elseif (t <= -4.8e-122) tmp = y + x; elseif (t <= -4.15e-286) tmp = x; elseif (t <= 6.2e+195) tmp = y + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e+190], t$95$1, If[LessEqual[t, -4.8e-122], N[(y + x), $MachinePrecision], If[LessEqual[t, -4.15e-286], x, If[LessEqual[t, 6.2e+195], N[(y + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{a}{t}}\\
\mathbf{if}\;t \leq -4 \cdot 10^{+190}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{-122}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -4.15 \cdot 10^{-286}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+195}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.0000000000000003e190 or 6.2000000000000004e195 < t Initial program 82.0%
+-commutative82.0%
associate-*r/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in x around 0 64.3%
Taylor expanded in z around 0 64.4%
neg-mul-164.4%
distribute-rgt-neg-in64.4%
Simplified64.4%
Taylor expanded in z around 0 51.1%
associate-/l*53.1%
Simplified53.1%
if -4.0000000000000003e190 < t < -4.79999999999999975e-122 or -4.15000000000000011e-286 < t < 6.2000000000000004e195Initial program 84.4%
+-commutative84.4%
associate-*r/99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in z around inf 66.6%
if -4.79999999999999975e-122 < t < -4.15000000000000011e-286Initial program 91.4%
+-commutative91.4%
associate-*r/97.2%
fma-def97.2%
Simplified97.2%
Taylor expanded in y around 0 80.1%
Final simplification65.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.7e+190)
(/ y (/ a t))
(if (<= t -5e-122)
(+ y x)
(if (<= t -7.8e-280) x (if (<= t 8.5e+231) (+ y x) (/ (* y t) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7e+190) {
tmp = y / (a / t);
} else if (t <= -5e-122) {
tmp = y + x;
} else if (t <= -7.8e-280) {
tmp = x;
} else if (t <= 8.5e+231) {
tmp = y + x;
} else {
tmp = (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 (t <= (-2.7d+190)) then
tmp = y / (a / t)
else if (t <= (-5d-122)) then
tmp = y + x
else if (t <= (-7.8d-280)) then
tmp = x
else if (t <= 8.5d+231) then
tmp = y + x
else
tmp = (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 (t <= -2.7e+190) {
tmp = y / (a / t);
} else if (t <= -5e-122) {
tmp = y + x;
} else if (t <= -7.8e-280) {
tmp = x;
} else if (t <= 8.5e+231) {
tmp = y + x;
} else {
tmp = (y * t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.7e+190: tmp = y / (a / t) elif t <= -5e-122: tmp = y + x elif t <= -7.8e-280: tmp = x elif t <= 8.5e+231: tmp = y + x else: tmp = (y * t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.7e+190) tmp = Float64(y / Float64(a / t)); elseif (t <= -5e-122) tmp = Float64(y + x); elseif (t <= -7.8e-280) tmp = x; elseif (t <= 8.5e+231) tmp = Float64(y + x); else tmp = Float64(Float64(y * t) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.7e+190) tmp = y / (a / t); elseif (t <= -5e-122) tmp = y + x; elseif (t <= -7.8e-280) tmp = x; elseif (t <= 8.5e+231) tmp = y + x; else tmp = (y * t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7e+190], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5e-122], N[(y + x), $MachinePrecision], If[LessEqual[t, -7.8e-280], x, If[LessEqual[t, 8.5e+231], N[(y + x), $MachinePrecision], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+190}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-122}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -7.8 \cdot 10^{-280}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+231}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\end{array}
\end{array}
if t < -2.70000000000000004e190Initial program 87.6%
+-commutative87.6%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around 0 71.1%
Taylor expanded in z around 0 71.0%
neg-mul-171.0%
distribute-rgt-neg-in71.0%
Simplified71.0%
Taylor expanded in z around 0 53.4%
associate-/l*61.5%
Simplified61.5%
if -2.70000000000000004e190 < t < -4.9999999999999999e-122 or -7.79999999999999996e-280 < t < 8.4999999999999994e231Initial program 83.6%
+-commutative83.6%
associate-*r/99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in z around inf 65.1%
if -4.9999999999999999e-122 < t < -7.79999999999999996e-280Initial program 91.4%
+-commutative91.4%
associate-*r/97.2%
fma-def97.2%
Simplified97.2%
Taylor expanded in y around 0 80.1%
if 8.4999999999999994e231 < t Initial program 81.4%
+-commutative81.4%
associate-*r/87.0%
fma-def87.1%
Simplified87.1%
Taylor expanded in x around 0 64.2%
Taylor expanded in z around 0 64.2%
neg-mul-164.2%
distribute-rgt-neg-in64.2%
Simplified64.2%
Taylor expanded in z around 0 57.4%
Final simplification66.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.2e-102) (+ x (* y (/ t a))) (if (<= a 7e+17) (+ x (* (- z t) (/ y z))) (+ x (/ y (/ a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.2e-102) {
tmp = x + (y * (t / a));
} else if (a <= 7e+17) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (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 (a <= (-2.2d-102)) then
tmp = x + (y * (t / a))
else if (a <= 7d+17) then
tmp = x + ((z - t) * (y / z))
else
tmp = x + (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 (a <= -2.2e-102) {
tmp = x + (y * (t / a));
} else if (a <= 7e+17) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.2e-102: tmp = x + (y * (t / a)) elif a <= 7e+17: tmp = x + ((z - t) * (y / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.2e-102) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (a <= 7e+17) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.2e-102) tmp = x + (y * (t / a)); elseif (a <= 7e+17) tmp = x + ((z - t) * (y / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.2e-102], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e+17], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{-102}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+17}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if a < -2.20000000000000013e-102Initial program 79.8%
+-commutative79.8%
associate-*r/99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
associate-/l*68.1%
associate-/r/73.8%
Applied egg-rr73.8%
if -2.20000000000000013e-102 < a < 7e17Initial program 90.7%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in z around inf 81.6%
if 7e17 < a Initial program 81.4%
+-commutative81.4%
associate-*r/98.2%
fma-def98.2%
Simplified98.2%
Taylor expanded in z around 0 68.9%
associate-/l*79.6%
Simplified79.6%
Final simplification78.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.5e+123) (+ y x) (if (<= z 3.45e+73) (- x (* y (/ t (- z a)))) (+ x (* (- z t) (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+123) {
tmp = y + x;
} else if (z <= 3.45e+73) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + ((z - t) * (y / 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 <= (-3.5d+123)) then
tmp = y + x
else if (z <= 3.45d+73) then
tmp = x - (y * (t / (z - a)))
else
tmp = x + ((z - t) * (y / 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 <= -3.5e+123) {
tmp = y + x;
} else if (z <= 3.45e+73) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + ((z - t) * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e+123: tmp = y + x elif z <= 3.45e+73: tmp = x - (y * (t / (z - a))) else: tmp = x + ((z - t) * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e+123) tmp = Float64(y + x); elseif (z <= 3.45e+73) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e+123) tmp = y + x; elseif (z <= 3.45e+73) tmp = x - (y * (t / (z - a))); else tmp = x + ((z - t) * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+123], N[(y + x), $MachinePrecision], If[LessEqual[z, 3.45e+73], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+123}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 3.45 \cdot 10^{+73}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -3.5e123Initial program 58.0%
+-commutative58.0%
associate-*r/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in z around inf 82.7%
if -3.5e123 < z < 3.4499999999999998e73Initial program 92.6%
+-commutative92.6%
associate-*r/97.5%
fma-def97.5%
Simplified97.5%
fma-udef97.5%
Applied egg-rr97.5%
Taylor expanded in t around inf 86.8%
neg-mul-186.8%
distribute-neg-frac86.8%
Simplified86.8%
Taylor expanded in y around 0 83.1%
+-commutative83.1%
mul-1-neg83.1%
associate-*r/86.8%
sub-neg86.8%
Simplified86.8%
if 3.4499999999999998e73 < z Initial program 79.6%
associate-*l/89.8%
Simplified89.8%
Taylor expanded in z around inf 87.8%
Final simplification86.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.1e+123) (+ y x) (if (<= z 4.8e+72) (+ x (/ y (/ (- a z) t))) (+ x (* (- z t) (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.1e+123) {
tmp = y + x;
} else if (z <= 4.8e+72) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + ((z - t) * (y / 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 <= (-8.1d+123)) then
tmp = y + x
else if (z <= 4.8d+72) then
tmp = x + (y / ((a - z) / t))
else
tmp = x + ((z - t) * (y / 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 <= -8.1e+123) {
tmp = y + x;
} else if (z <= 4.8e+72) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + ((z - t) * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.1e+123: tmp = y + x elif z <= 4.8e+72: tmp = x + (y / ((a - z) / t)) else: tmp = x + ((z - t) * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.1e+123) tmp = Float64(y + x); elseif (z <= 4.8e+72) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.1e+123) tmp = y + x; elseif (z <= 4.8e+72) tmp = x + (y / ((a - z) / t)); else tmp = x + ((z - t) * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.1e+123], N[(y + x), $MachinePrecision], If[LessEqual[z, 4.8e+72], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.1 \cdot 10^{+123}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+72}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -8.0999999999999998e123Initial program 58.0%
+-commutative58.0%
associate-*r/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in z around inf 82.7%
if -8.0999999999999998e123 < z < 4.8000000000000002e72Initial program 92.6%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in t around inf 86.9%
associate-*r/86.9%
neg-mul-186.9%
sub-neg86.9%
mul-1-neg86.9%
distribute-neg-in86.9%
mul-1-neg86.9%
remove-double-neg86.9%
Simplified86.9%
if 4.8000000000000002e72 < z Initial program 79.6%
associate-*l/89.8%
Simplified89.8%
Taylor expanded in z around inf 87.8%
Final simplification86.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.2e+54) (not (<= z 2.8e+71))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e+54) || !(z <= 2.8e+71)) {
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 <= (-9.2d+54)) .or. (.not. (z <= 2.8d+71))) 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 <= -9.2e+54) || !(z <= 2.8e+71)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e+54) or not (z <= 2.8e+71): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e+54) || !(z <= 2.8e+71)) 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 <= -9.2e+54) || ~((z <= 2.8e+71))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.2e+54], N[Not[LessEqual[z, 2.8e+71]], $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 -9.2 \cdot 10^{+54} \lor \neg \left(z \leq 2.8 \cdot 10^{+71}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -9.19999999999999977e54 or 2.80000000000000002e71 < z Initial program 73.0%
+-commutative73.0%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around inf 82.2%
if -9.19999999999999977e54 < z < 2.80000000000000002e71Initial program 92.7%
+-commutative92.7%
associate-*r/97.3%
fma-def97.3%
Simplified97.3%
Taylor expanded in z around 0 72.9%
*-commutative72.9%
associate-/l*75.2%
associate-/r/77.0%
Applied egg-rr77.0%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Initial program 84.9%
associate-*l/93.7%
Simplified93.7%
Final simplification93.7%
(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}
Initial program 84.9%
associate-/l*98.0%
Simplified98.0%
Final simplification98.0%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 84.9%
+-commutative84.9%
associate-*r/98.3%
fma-def98.3%
Simplified98.3%
fma-udef98.3%
Applied egg-rr98.3%
Final simplification98.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.55e-77) (+ y x) (if (<= z 3.2e-82) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e-77) {
tmp = y + x;
} else if (z <= 3.2e-82) {
tmp = x;
} 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 (z <= (-1.55d-77)) then
tmp = y + x
else if (z <= 3.2d-82) then
tmp = x
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 (z <= -1.55e-77) {
tmp = y + x;
} else if (z <= 3.2e-82) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.55e-77: tmp = y + x elif z <= 3.2e-82: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e-77) tmp = Float64(y + x); elseif (z <= 3.2e-82) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.55e-77) tmp = y + x; elseif (z <= 3.2e-82) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e-77], N[(y + x), $MachinePrecision], If[LessEqual[z, 3.2e-82], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-77}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-82}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.55000000000000004e-77 or 3.2000000000000001e-82 < z Initial program 78.9%
+-commutative78.9%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around inf 71.8%
if -1.55000000000000004e-77 < z < 3.2000000000000001e-82Initial program 95.0%
+-commutative95.0%
associate-*r/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in y around 0 50.4%
Final simplification63.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.84e+129) y (if (<= y 1.56e+220) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.84e+129) {
tmp = y;
} else if (y <= 1.56e+220) {
tmp = x;
} else {
tmp = 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 (y <= (-5.84d+129)) then
tmp = y
else if (y <= 1.56d+220) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.84e+129) {
tmp = y;
} else if (y <= 1.56e+220) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.84e+129: tmp = y elif y <= 1.56e+220: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.84e+129) tmp = y; elseif (y <= 1.56e+220) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.84e+129) tmp = y; elseif (y <= 1.56e+220) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.84e+129], y, If[LessEqual[y, 1.56e+220], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.84 \cdot 10^{+129}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 1.56 \cdot 10^{+220}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -5.83999999999999967e129 or 1.56e220 < y Initial program 56.5%
+-commutative56.5%
associate-*r/99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in x around 0 53.2%
Taylor expanded in z around inf 37.5%
if -5.83999999999999967e129 < y < 1.56e220Initial program 93.6%
+-commutative93.6%
associate-*r/98.0%
fma-def98.0%
Simplified98.0%
Taylor expanded in y around 0 58.6%
Final simplification53.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 84.9%
+-commutative84.9%
associate-*r/98.3%
fma-def98.3%
Simplified98.3%
Taylor expanded in y around 0 47.3%
Final simplification47.3%
(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 2023176
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))