
(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 9 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 (+ 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}
Initial program 97.3%
Final simplification97.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))))
(if (<= t_1 -1e+44)
(- x (* z (/ y t)))
(if (<= t_1 5e-24)
(+ x (/ y (/ a z)))
(if (<= t_1 4e+81) (+ x y) (/ (* y z) (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if (t_1 <= -1e+44) {
tmp = x - (z * (y / t));
} else if (t_1 <= 5e-24) {
tmp = x + (y / (a / z));
} else if (t_1 <= 4e+81) {
tmp = x + y;
} else {
tmp = (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 = (z - t) / (a - t)
if (t_1 <= (-1d+44)) then
tmp = x - (z * (y / t))
else if (t_1 <= 5d-24) then
tmp = x + (y / (a / z))
else if (t_1 <= 4d+81) then
tmp = x + y
else
tmp = (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 = (z - t) / (a - t);
double tmp;
if (t_1 <= -1e+44) {
tmp = x - (z * (y / t));
} else if (t_1 <= 5e-24) {
tmp = x + (y / (a / z));
} else if (t_1 <= 4e+81) {
tmp = x + y;
} else {
tmp = (y * z) / (a - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) tmp = 0 if t_1 <= -1e+44: tmp = x - (z * (y / t)) elif t_1 <= 5e-24: tmp = x + (y / (a / z)) elif t_1 <= 4e+81: tmp = x + y else: tmp = (y * z) / (a - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) tmp = 0.0 if (t_1 <= -1e+44) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t_1 <= 5e-24) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t_1 <= 4e+81) tmp = Float64(x + y); else tmp = Float64(Float64(y * z) / Float64(a - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); tmp = 0.0; if (t_1 <= -1e+44) tmp = x - (z * (y / t)); elseif (t_1 <= 5e-24) tmp = x + (y / (a / z)); elseif (t_1 <= 4e+81) tmp = x + y; else tmp = (y * z) / (a - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+44], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-24], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+81], N[(x + y), $MachinePrecision], N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+44}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-24}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+81}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -1.0000000000000001e44Initial program 91.1%
Taylor expanded in z around inf 91.1%
Taylor expanded in a around 0 69.3%
+-commutative69.3%
mul-1-neg69.3%
unsub-neg69.3%
associate-*l/75.3%
*-commutative75.3%
Simplified75.3%
if -1.0000000000000001e44 < (/.f64 (-.f64 z t) (-.f64 a t)) < 4.9999999999999998e-24Initial program 99.0%
Taylor expanded in t around 0 85.0%
associate-/l*86.9%
Simplified86.9%
if 4.9999999999999998e-24 < (/.f64 (-.f64 z t) (-.f64 a t)) < 3.99999999999999969e81Initial program 100.0%
Taylor expanded in t around inf 91.0%
if 3.99999999999999969e81 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 84.7%
Taylor expanded in x around 0 80.5%
Taylor expanded in z around inf 80.5%
Final simplification86.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))))
(if (or (<= t_1 5e-24) (not (<= t_1 1.0)))
(+ x (* y (/ z (- a t))))
(+ x y))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if ((t_1 <= 5e-24) || !(t_1 <= 1.0)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + 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) :: t_1
real(8) :: tmp
t_1 = (z - t) / (a - t)
if ((t_1 <= 5d-24) .or. (.not. (t_1 <= 1.0d0))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if ((t_1 <= 5e-24) || !(t_1 <= 1.0)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) tmp = 0 if (t_1 <= 5e-24) or not (t_1 <= 1.0): tmp = x + (y * (z / (a - t))) else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) tmp = 0.0 if ((t_1 <= 5e-24) || !(t_1 <= 1.0)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); tmp = 0.0; if ((t_1 <= 5e-24) || ~((t_1 <= 1.0))) tmp = x + (y * (z / (a - t))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 5e-24], N[Not[LessEqual[t$95$1, 1.0]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{-24} \lor \neg \left(t_1 \leq 1\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < 4.9999999999999998e-24 or 1 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 95.9%
Taylor expanded in z around inf 88.3%
if 4.9999999999999998e-24 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1Initial program 100.0%
Taylor expanded in t around inf 95.6%
Final simplification90.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))))
(if (or (<= t_1 1e-153) (not (<= t_1 1.0)))
(+ x (* y (/ z (- a t))))
(+ x (/ y (- 1.0 (/ a t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if ((t_1 <= 1e-153) || !(t_1 <= 1.0)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (y / (1.0 - (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 = (z - t) / (a - t)
if ((t_1 <= 1d-153) .or. (.not. (t_1 <= 1.0d0))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x + (y / (1.0d0 - (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 = (z - t) / (a - t);
double tmp;
if ((t_1 <= 1e-153) || !(t_1 <= 1.0)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (y / (1.0 - (a / t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) tmp = 0 if (t_1 <= 1e-153) or not (t_1 <= 1.0): tmp = x + (y * (z / (a - t))) else: tmp = x + (y / (1.0 - (a / t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) tmp = 0.0 if ((t_1 <= 1e-153) || !(t_1 <= 1.0)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); tmp = 0.0; if ((t_1 <= 1e-153) || ~((t_1 <= 1.0))) tmp = x + (y * (z / (a - t))); else tmp = x + (y / (1.0 - (a / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 1e-153], N[Not[LessEqual[t$95$1, 1.0]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
\mathbf{if}\;t_1 \leq 10^{-153} \lor \neg \left(t_1 \leq 1\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{t}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < 1.00000000000000004e-153 or 1 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 95.1%
Taylor expanded in z around inf 89.7%
if 1.00000000000000004e-153 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1Initial program 100.0%
Taylor expanded in z around 0 75.1%
mul-1-neg75.1%
associate-/l*96.6%
distribute-neg-frac96.6%
div-sub96.6%
*-inverses96.6%
Simplified96.6%
frac-2neg96.6%
div-inv96.6%
remove-double-neg96.6%
sub-neg96.6%
distribute-neg-in96.6%
metadata-eval96.6%
metadata-eval96.6%
Applied egg-rr96.6%
associate-*r/96.6%
*-rgt-identity96.6%
+-commutative96.6%
unsub-neg96.6%
Simplified96.6%
Final simplification92.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.1e+25) (+ x y) (if (<= t 1e+29) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e+25) {
tmp = x + y;
} else if (t <= 1e+29) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.1d+25)) then
tmp = x + y
else if (t <= 1d+29) then
tmp = x + (y * (z / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e+25) {
tmp = x + y;
} else if (t <= 1e+29) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.1e+25: tmp = x + y elif t <= 1e+29: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.1e+25) tmp = Float64(x + y); elseif (t <= 1e+29) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.1e+25) tmp = x + y; elseif (t <= 1e+29) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.1e+25], N[(x + y), $MachinePrecision], If[LessEqual[t, 1e+29], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+25}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 10^{+29}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.0999999999999998e25 or 9.99999999999999914e28 < t Initial program 99.9%
Taylor expanded in t around inf 79.5%
if -3.0999999999999998e25 < t < 9.99999999999999914e28Initial program 95.2%
Taylor expanded in t around 0 81.4%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.65e+26) (+ x y) (if (<= t 1.05e+29) (+ x (/ y (/ a z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.65e+26) {
tmp = x + y;
} else if (t <= 1.05e+29) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.65d+26)) then
tmp = x + y
else if (t <= 1.05d+29) then
tmp = x + (y / (a / z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.65e+26) {
tmp = x + y;
} else if (t <= 1.05e+29) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.65e+26: tmp = x + y elif t <= 1.05e+29: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.65e+26) tmp = Float64(x + y); elseif (t <= 1.05e+29) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.65e+26) tmp = x + y; elseif (t <= 1.05e+29) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.65e+26], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.05e+29], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+26}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+29}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.64999999999999997e26 or 1.0500000000000001e29 < t Initial program 99.9%
Taylor expanded in t around inf 79.5%
if -1.64999999999999997e26 < t < 1.0500000000000001e29Initial program 95.2%
Taylor expanded in t around 0 80.3%
associate-/l*81.9%
Simplified81.9%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.8e-18) x (if (<= a 1e+141) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.8e-18) {
tmp = x;
} else if (a <= 1e+141) {
tmp = x + y;
} 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 <= (-9.8d-18)) then
tmp = x
else if (a <= 1d+141) then
tmp = x + y
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 <= -9.8e-18) {
tmp = x;
} else if (a <= 1e+141) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.8e-18: tmp = x elif a <= 1e+141: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.8e-18) tmp = x; elseif (a <= 1e+141) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.8e-18) tmp = x; elseif (a <= 1e+141) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.8e-18], x, If[LessEqual[a, 1e+141], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.8 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 10^{+141}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.8000000000000002e-18 or 1.00000000000000002e141 < a Initial program 99.0%
Taylor expanded in x around inf 69.6%
if -9.8000000000000002e-18 < a < 1.00000000000000002e141Initial program 96.1%
Taylor expanded in t around inf 66.6%
Final simplification67.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -9.5e-252) x (if (<= x 1.2e-287) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -9.5e-252) {
tmp = x;
} else if (x <= 1.2e-287) {
tmp = y;
} 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 (x <= (-9.5d-252)) then
tmp = x
else if (x <= 1.2d-287) then
tmp = y
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 (x <= -9.5e-252) {
tmp = x;
} else if (x <= 1.2e-287) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -9.5e-252: tmp = x elif x <= 1.2e-287: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -9.5e-252) tmp = x; elseif (x <= 1.2e-287) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -9.5e-252) tmp = x; elseif (x <= 1.2e-287) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -9.5e-252], x, If[LessEqual[x, 1.2e-287], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-252}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-287}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.4999999999999993e-252 or 1.2e-287 < x Initial program 97.0%
Taylor expanded in x around inf 62.8%
if -9.4999999999999993e-252 < x < 1.2e-287Initial program 99.9%
Taylor expanded in x around 0 62.8%
Taylor expanded in t around inf 54.1%
Final simplification61.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 97.3%
Taylor expanded in x around inf 57.8%
Final simplification57.8%
(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 2023279
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(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)))))