
(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 (let* ((t_1 (* y (/ (- z t) (- a t))))) (if (<= t_1 (- INFINITY)) (+ x (* (- z t) (/ y (- a t)))) (+ t_1 x))))
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 <= -((double) INFINITY)) {
tmp = x + ((z - t) * (y / (a - t)));
} else {
tmp = t_1 + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((z - t) * (y / (a - t)));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (a - t)) tmp = 0 if t_1 <= -math.inf: tmp = x + ((z - t) * (y / (a - t))) else: tmp = t_1 + x 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 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))); else tmp = Float64(t_1 + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (a - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((z - t) * (y / (a - t))); else tmp = t_1 + x; 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, (-Infinity)], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < -inf.0Initial program 61.2%
associate-*r/99.7%
Simplified99.7%
*-commutative99.7%
associate-/l*99.9%
Applied egg-rr99.9%
if -inf.0 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 98.7%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- a t))))) (if (<= t_1 (- INFINITY)) (+ x (/ (* y z) (- a t))) (+ t_1 x))))
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 <= -((double) INFINITY)) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = t_1 + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (a - t)) tmp = 0 if t_1 <= -math.inf: tmp = x + ((y * z) / (a - t)) else: tmp = t_1 + x 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 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(t_1 + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (a - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((y * z) / (a - t)); else tmp = t_1 + x; 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, (-Infinity)], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < -inf.0Initial program 61.2%
Taylor expanded in z around inf 99.7%
if -inf.0 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 98.7%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.3e+49) (not (<= t 1.65e+84))) (+ y x) (+ x (/ (* y z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.3e+49) || !(t <= 1.65e+84)) {
tmp = y + 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) :: tmp
if ((t <= (-2.3d+49)) .or. (.not. (t <= 1.65d+84))) then
tmp = y + 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 tmp;
if ((t <= -2.3e+49) || !(t <= 1.65e+84)) {
tmp = y + x;
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.3e+49) or not (t <= 1.65e+84): tmp = y + x else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.3e+49) || !(t <= 1.65e+84)) tmp = Float64(y + 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) tmp = 0.0; if ((t <= -2.3e+49) || ~((t <= 1.65e+84))) tmp = y + x; else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.3e+49], N[Not[LessEqual[t, 1.65e+84]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+49} \lor \neg \left(t \leq 1.65 \cdot 10^{+84}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -2.30000000000000002e49 or 1.65000000000000008e84 < t Initial program 100.0%
Taylor expanded in t around inf 84.8%
+-commutative84.8%
Simplified84.8%
if -2.30000000000000002e49 < t < 1.65000000000000008e84Initial program 95.0%
Taylor expanded in z around inf 88.6%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e+56) (not (<= t 3.7e+84))) (+ y x) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+56) || !(t <= 3.7e+84)) {
tmp = y + 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) :: tmp
if ((t <= (-4.8d+56)) .or. (.not. (t <= 3.7d+84))) then
tmp = y + 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 tmp;
if ((t <= -4.8e+56) || !(t <= 3.7e+84)) {
tmp = y + x;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e+56) or not (t <= 3.7e+84): tmp = y + x else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e+56) || !(t <= 3.7e+84)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.8e+56) || ~((t <= 3.7e+84))) tmp = y + x; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e+56], N[Not[LessEqual[t, 3.7e+84]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+56} \lor \neg \left(t \leq 3.7 \cdot 10^{+84}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -4.80000000000000027e56 or 3.7e84 < t Initial program 100.0%
Taylor expanded in t around inf 84.7%
+-commutative84.7%
Simplified84.7%
if -4.80000000000000027e56 < t < 3.7e84Initial program 95.0%
Taylor expanded in z around inf 88.0%
associate-/l*88.1%
Simplified88.1%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.4e-24) (+ x (* y (/ t (- t a)))) (if (<= t 3e+25) (+ x (/ (* y z) (- a t))) (+ x (* y (- 1.0 (/ z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.4e-24) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 3e+25) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y * (1.0 - (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 (t <= (-4.4d-24)) then
tmp = x + (y * (t / (t - a)))
else if (t <= 3d+25) then
tmp = x + ((y * z) / (a - t))
else
tmp = x + (y * (1.0d0 - (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 (t <= -4.4e-24) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 3e+25) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y * (1.0 - (z / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.4e-24: tmp = x + (y * (t / (t - a))) elif t <= 3e+25: tmp = x + ((y * z) / (a - t)) else: tmp = x + (y * (1.0 - (z / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.4e-24) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); elseif (t <= 3e+25) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.4e-24) tmp = x + (y * (t / (t - a))); elseif (t <= 3e+25) tmp = x + ((y * z) / (a - t)); else tmp = x + (y * (1.0 - (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.4e-24], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+25], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{-24}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+25}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\end{array}
\end{array}
if t < -4.40000000000000003e-24Initial program 100.0%
Taylor expanded in z around 0 83.8%
mul-1-neg83.8%
unsub-neg83.8%
*-commutative83.8%
associate-/l*95.1%
Simplified95.1%
if -4.40000000000000003e-24 < t < 3.00000000000000006e25Initial program 94.3%
Taylor expanded in z around inf 89.9%
if 3.00000000000000006e25 < t Initial program 99.9%
Taylor expanded in a around 0 72.6%
mul-1-neg72.6%
unsub-neg72.6%
associate-/l*89.1%
div-sub89.1%
sub-neg89.1%
*-inverses89.1%
metadata-eval89.1%
Simplified89.1%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -9e+50) (+ y x) (if (<= t 4.5e+31) (+ x (/ (* y z) (- a t))) (+ x (* y (- 1.0 (/ z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+50) {
tmp = y + x;
} else if (t <= 4.5e+31) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y * (1.0 - (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 (t <= (-9d+50)) then
tmp = y + x
else if (t <= 4.5d+31) then
tmp = x + ((y * z) / (a - t))
else
tmp = x + (y * (1.0d0 - (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 (t <= -9e+50) {
tmp = y + x;
} else if (t <= 4.5e+31) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y * (1.0 - (z / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9e+50: tmp = y + x elif t <= 4.5e+31: tmp = x + ((y * z) / (a - t)) else: tmp = x + (y * (1.0 - (z / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9e+50) tmp = Float64(y + x); elseif (t <= 4.5e+31) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9e+50) tmp = y + x; elseif (t <= 4.5e+31) tmp = x + ((y * z) / (a - t)); else tmp = x + (y * (1.0 - (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9e+50], N[(y + x), $MachinePrecision], If[LessEqual[t, 4.5e+31], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+50}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+31}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\end{array}
\end{array}
if t < -9.00000000000000027e50Initial program 100.0%
Taylor expanded in t around inf 93.1%
+-commutative93.1%
Simplified93.1%
if -9.00000000000000027e50 < t < 4.4999999999999996e31Initial program 94.7%
Taylor expanded in z around inf 89.9%
if 4.4999999999999996e31 < t Initial program 99.9%
Taylor expanded in a around 0 72.6%
mul-1-neg72.6%
unsub-neg72.6%
associate-/l*89.1%
div-sub89.1%
sub-neg89.1%
*-inverses89.1%
metadata-eval89.1%
Simplified89.1%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.05e-57) (not (<= t 4.5e+42))) (+ y x) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.05e-57) || !(t <= 4.5e+42)) {
tmp = y + x;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.05d-57)) .or. (.not. (t <= 4.5d+42))) then
tmp = y + x
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.05e-57) || !(t <= 4.5e+42)) {
tmp = y + x;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.05e-57) or not (t <= 4.5e+42): tmp = y + x else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.05e-57) || !(t <= 4.5e+42)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.05e-57) || ~((t <= 4.5e+42))) tmp = y + x; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.05e-57], N[Not[LessEqual[t, 4.5e+42]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{-57} \lor \neg \left(t \leq 4.5 \cdot 10^{+42}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.0500000000000001e-57 or 4.50000000000000012e42 < t Initial program 100.0%
Taylor expanded in t around inf 81.6%
+-commutative81.6%
Simplified81.6%
if -2.0500000000000001e-57 < t < 4.50000000000000012e42Initial program 94.1%
clear-num94.1%
un-div-inv94.0%
Applied egg-rr94.0%
Taylor expanded in t around 0 79.4%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.8e-57) (not (<= t 1.18e+38))) (+ y x) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e-57) || !(t <= 1.18e+38)) {
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-57)) .or. (.not. (t <= 1.18d+38))) 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-57) || !(t <= 1.18e+38)) {
tmp = y + x;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.8e-57) or not (t <= 1.18e+38): 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-57) || !(t <= 1.18e+38)) 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-57) || ~((t <= 1.18e+38))) tmp = y + x; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.8e-57], N[Not[LessEqual[t, 1.18e+38]], $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^{-57} \lor \neg \left(t \leq 1.18 \cdot 10^{+38}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.8000000000000001e-57 or 1.18e38 < t Initial program 100.0%
Taylor expanded in t around inf 81.6%
+-commutative81.6%
Simplified81.6%
if -1.8000000000000001e-57 < t < 1.18e38Initial program 94.1%
Taylor expanded in t around 0 77.9%
*-commutative77.9%
associate-/l*77.7%
Applied egg-rr77.7%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (<= x -3e-75) x (if (<= x 3.3e-255) (* y (- 1.0 (/ z t))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3e-75) {
tmp = x;
} else if (x <= 3.3e-255) {
tmp = y * (1.0 - (z / 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 (x <= (-3d-75)) then
tmp = x
else if (x <= 3.3d-255) then
tmp = y * (1.0d0 - (z / 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 (x <= -3e-75) {
tmp = x;
} else if (x <= 3.3e-255) {
tmp = y * (1.0 - (z / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -3e-75: tmp = x elif x <= 3.3e-255: tmp = y * (1.0 - (z / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3e-75) tmp = x; elseif (x <= 3.3e-255) tmp = Float64(y * Float64(1.0 - Float64(z / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -3e-75) tmp = x; elseif (x <= 3.3e-255) tmp = y * (1.0 - (z / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3e-75], x, If[LessEqual[x, 3.3e-255], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-75}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-255}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if x < -2.9999999999999999e-75Initial program 98.8%
Taylor expanded in x around inf 73.2%
if -2.9999999999999999e-75 < x < 3.29999999999999988e-255Initial program 96.7%
Taylor expanded in a around 0 51.4%
mul-1-neg51.4%
unsub-neg51.4%
associate-/l*59.0%
div-sub59.0%
sub-neg59.0%
*-inverses59.0%
metadata-eval59.0%
Simplified59.0%
Taylor expanded in y around inf 51.8%
if 3.29999999999999988e-255 < x Initial program 95.8%
Taylor expanded in t around inf 67.5%
+-commutative67.5%
Simplified67.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.55e-41) (not (<= t 1.2e+32))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.55e-41) || !(t <= 1.2e+32)) {
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 ((t <= (-1.55d-41)) .or. (.not. (t <= 1.2d+32))) 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 ((t <= -1.55e-41) || !(t <= 1.2e+32)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.55e-41) or not (t <= 1.2e+32): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.55e-41) || !(t <= 1.2e+32)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.55e-41) || ~((t <= 1.2e+32))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.55e-41], N[Not[LessEqual[t, 1.2e+32]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{-41} \lor \neg \left(t \leq 1.2 \cdot 10^{+32}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.55e-41 or 1.19999999999999996e32 < t Initial program 100.0%
Taylor expanded in t around inf 82.2%
+-commutative82.2%
Simplified82.2%
if -1.55e-41 < t < 1.19999999999999996e32Initial program 94.1%
Taylor expanded in x around inf 48.9%
Final simplification65.1%
(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.0%
Taylor expanded in x around inf 52.5%
(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 2024087
(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)))))