
(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 12 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 98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.3e+117)
(+ x y)
(if (<= t 3.4e-89)
(+ x (* z (/ y a)))
(if (<= t 2.65e+134) (- x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.3e+117) {
tmp = x + y;
} else if (t <= 3.4e-89) {
tmp = x + (z * (y / a));
} else if (t <= 2.65e+134) {
tmp = x - (y * (z / 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) :: tmp
if (t <= (-3.3d+117)) then
tmp = x + y
else if (t <= 3.4d-89) then
tmp = x + (z * (y / a))
else if (t <= 2.65d+134) then
tmp = x - (y * (z / 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 tmp;
if (t <= -3.3e+117) {
tmp = x + y;
} else if (t <= 3.4e-89) {
tmp = x + (z * (y / a));
} else if (t <= 2.65e+134) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.3e+117: tmp = x + y elif t <= 3.4e-89: tmp = x + (z * (y / a)) elif t <= 2.65e+134: tmp = x - (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.3e+117) tmp = Float64(x + y); elseif (t <= 3.4e-89) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (t <= 2.65e+134) tmp = Float64(x - Float64(y * Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.3e+117) tmp = x + y; elseif (t <= 3.4e-89) tmp = x + (z * (y / a)); elseif (t <= 2.65e+134) tmp = x - (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.3e+117], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.4e-89], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.65e+134], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+117}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-89}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{+134}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.2999999999999998e117 or 2.6500000000000001e134 < t Initial program 99.9%
Taylor expanded in t around inf 81.8%
+-commutative81.8%
Simplified81.8%
if -3.2999999999999998e117 < t < 3.4e-89Initial program 96.6%
Taylor expanded in z around inf 87.8%
div-inv87.8%
*-commutative87.8%
associate-*l*90.5%
div-inv90.6%
Applied egg-rr90.6%
Taylor expanded in a around inf 77.4%
if 3.4e-89 < t < 2.6500000000000001e134Initial program 100.0%
Taylor expanded in z around inf 90.2%
Taylor expanded in a around 0 81.0%
mul-1-neg81.0%
unsub-neg81.0%
associate-/l*83.5%
Simplified83.5%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.55e+126) (not (<= t 4.1e+135))) (+ x (* y (/ t (- t a)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.55e+126) || !(t <= 4.1e+135)) {
tmp = x + (y * (t / (t - a)));
} 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 <= (-1.55d+126)) .or. (.not. (t <= 4.1d+135))) then
tmp = x + (y * (t / (t - a)))
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 <= -1.55e+126) || !(t <= 4.1e+135)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.55e+126) or not (t <= 4.1e+135): tmp = x + (y * (t / (t - a))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.55e+126) || !(t <= 4.1e+135)) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); 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 <= -1.55e+126) || ~((t <= 4.1e+135))) tmp = x + (y * (t / (t - a))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.55e+126], N[Not[LessEqual[t, 4.1e+135]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $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 -1.55 \cdot 10^{+126} \lor \neg \left(t \leq 4.1 \cdot 10^{+135}\right):\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.55e126 or 4.1e135 < t Initial program 99.9%
Taylor expanded in z around 0 57.8%
+-commutative57.8%
associate-*r/57.8%
mul-1-neg57.8%
distribute-lft-neg-out57.8%
*-commutative57.8%
*-lft-identity57.8%
times-frac87.1%
/-rgt-identity87.1%
distribute-neg-frac87.1%
distribute-neg-frac287.1%
neg-sub087.1%
sub-neg87.1%
+-commutative87.1%
associate--r+87.1%
neg-sub087.1%
remove-double-neg87.1%
Simplified87.1%
if -1.55e126 < t < 4.1e135Initial program 97.4%
Taylor expanded in z around inf 87.8%
div-inv87.8%
*-commutative87.8%
associate-*l*90.9%
div-inv90.9%
Applied egg-rr90.9%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.8e+193) (not (<= t 3.05e+134))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.8e+193) || !(t <= 3.05e+134)) {
tmp = x + y;
} 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 <= (-3.8d+193)) .or. (.not. (t <= 3.05d+134))) then
tmp = x + y
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 <= -3.8e+193) || !(t <= 3.05e+134)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.8e+193) or not (t <= 3.05e+134): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.8e+193) || !(t <= 3.05e+134)) tmp = Float64(x + y); 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 <= -3.8e+193) || ~((t <= 3.05e+134))) tmp = x + y; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.8e+193], N[Not[LessEqual[t, 3.05e+134]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+193} \lor \neg \left(t \leq 3.05 \cdot 10^{+134}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -3.79999999999999972e193 or 3.04999999999999989e134 < t Initial program 99.9%
Taylor expanded in t around inf 89.5%
+-commutative89.5%
Simplified89.5%
if -3.79999999999999972e193 < t < 3.04999999999999989e134Initial program 97.5%
Taylor expanded in z around inf 85.7%
div-inv85.7%
*-commutative85.7%
associate-*l*88.2%
div-inv88.2%
Applied egg-rr88.2%
Final simplification88.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -9e+123)
(+ x (* y (/ t (- t a))))
(if (<= t 2.95e+38)
(+ x (* z (/ y (- a t))))
(- x (* y (+ (/ z t) -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+123) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 2.95e+38) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y * ((z / t) + -1.0));
}
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+123)) then
tmp = x + (y * (t / (t - a)))
else if (t <= 2.95d+38) then
tmp = x + (z * (y / (a - t)))
else
tmp = x - (y * ((z / t) + (-1.0d0)))
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+123) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 2.95e+38) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y * ((z / t) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9e+123: tmp = x + (y * (t / (t - a))) elif t <= 2.95e+38: tmp = x + (z * (y / (a - t))) else: tmp = x - (y * ((z / t) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9e+123) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); elseif (t <= 2.95e+38) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9e+123) tmp = x + (y * (t / (t - a))); elseif (t <= 2.95e+38) tmp = x + (z * (y / (a - t))); else tmp = x - (y * ((z / t) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9e+123], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.95e+38], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+123}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{elif}\;t \leq 2.95 \cdot 10^{+38}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\end{array}
\end{array}
if t < -8.99999999999999965e123Initial program 100.0%
Taylor expanded in z around 0 59.2%
+-commutative59.2%
associate-*r/59.2%
mul-1-neg59.2%
distribute-lft-neg-out59.2%
*-commutative59.2%
*-lft-identity59.2%
times-frac88.0%
/-rgt-identity88.0%
distribute-neg-frac88.0%
distribute-neg-frac288.0%
neg-sub088.0%
sub-neg88.0%
+-commutative88.0%
associate--r+88.0%
neg-sub088.0%
remove-double-neg88.0%
Simplified88.0%
if -8.99999999999999965e123 < t < 2.94999999999999991e38Initial program 97.2%
Taylor expanded in z around inf 88.6%
div-inv88.6%
*-commutative88.6%
associate-*l*91.3%
div-inv91.4%
Applied egg-rr91.4%
if 2.94999999999999991e38 < t Initial program 99.9%
Taylor expanded in a around 0 68.8%
mul-1-neg68.8%
unsub-neg68.8%
associate-/l*96.3%
div-sub96.3%
sub-neg96.3%
*-inverses96.3%
metadata-eval96.3%
Simplified96.3%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.45e+117) (not (<= t 1.3e+38))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.45e+117) || !(t <= 1.3e+38)) {
tmp = x + y;
} 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 <= (-2.45d+117)) .or. (.not. (t <= 1.3d+38))) then
tmp = x + y
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 <= -2.45e+117) || !(t <= 1.3e+38)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.45e+117) or not (t <= 1.3e+38): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.45e+117) || !(t <= 1.3e+38)) tmp = Float64(x + y); 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 <= -2.45e+117) || ~((t <= 1.3e+38))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.45e+117], N[Not[LessEqual[t, 1.3e+38]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{+117} \lor \neg \left(t \leq 1.3 \cdot 10^{+38}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.45e117 or 1.3e38 < t Initial program 99.9%
Taylor expanded in t around inf 79.0%
+-commutative79.0%
Simplified79.0%
if -2.45e117 < t < 1.3e38Initial program 97.1%
Taylor expanded in z around inf 89.1%
div-inv89.1%
*-commutative89.1%
associate-*l*91.3%
div-inv91.3%
Applied egg-rr91.3%
Taylor expanded in a around inf 74.8%
Final simplification76.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.22e+55) (not (<= y 1.85e+136))) (* y (- 1.0 (/ z t))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.22e+55) || !(y <= 1.85e+136)) {
tmp = y * (1.0 - (z / 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) :: tmp
if ((y <= (-1.22d+55)) .or. (.not. (y <= 1.85d+136))) then
tmp = y * (1.0d0 - (z / 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 tmp;
if ((y <= -1.22e+55) || !(y <= 1.85e+136)) {
tmp = y * (1.0 - (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.22e+55) or not (y <= 1.85e+136): tmp = y * (1.0 - (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.22e+55) || !(y <= 1.85e+136)) tmp = Float64(y * Float64(1.0 - Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.22e+55) || ~((y <= 1.85e+136))) tmp = y * (1.0 - (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.22e+55], N[Not[LessEqual[y, 1.85e+136]], $MachinePrecision]], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+55} \lor \neg \left(y \leq 1.85 \cdot 10^{+136}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.22e55 or 1.85000000000000005e136 < y Initial program 98.0%
clear-num97.9%
un-div-inv98.0%
Applied egg-rr98.0%
Taylor expanded in a around 0 41.2%
mul-1-neg41.2%
unsub-neg41.2%
associate-/l*60.5%
div-sub60.5%
*-inverses60.5%
Simplified60.5%
Taylor expanded in x around 0 52.0%
sub-neg52.0%
metadata-eval52.0%
neg-mul-152.0%
distribute-rgt-neg-in52.0%
+-commutative52.0%
distribute-neg-in52.0%
metadata-eval52.0%
sub-neg52.0%
Simplified52.0%
if -1.22e55 < y < 1.85000000000000005e136Initial program 98.1%
Taylor expanded in t around inf 69.4%
+-commutative69.4%
Simplified69.4%
Final simplification62.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e+121) (not (<= z 2.9e+227))) (* y (/ (- z) t)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e+121) || !(z <= 2.9e+227)) {
tmp = y * (-z / 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) :: tmp
if ((z <= (-1.35d+121)) .or. (.not. (z <= 2.9d+227))) then
tmp = y * (-z / 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 tmp;
if ((z <= -1.35e+121) || !(z <= 2.9e+227)) {
tmp = y * (-z / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e+121) or not (z <= 2.9e+227): tmp = y * (-z / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e+121) || !(z <= 2.9e+227)) tmp = Float64(y * Float64(Float64(-z) / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.35e+121) || ~((z <= 2.9e+227))) tmp = y * (-z / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e+121], N[Not[LessEqual[z, 2.9e+227]], $MachinePrecision]], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+121} \lor \neg \left(z \leq 2.9 \cdot 10^{+227}\right):\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.3500000000000001e121 or 2.8999999999999998e227 < z Initial program 96.4%
clear-num96.4%
un-div-inv96.5%
Applied egg-rr96.5%
Taylor expanded in a around 0 56.9%
mul-1-neg56.9%
unsub-neg56.9%
associate-/l*62.0%
div-sub62.0%
*-inverses62.0%
Simplified62.0%
Taylor expanded in z around inf 49.5%
mul-1-neg49.5%
distribute-neg-frac249.5%
associate-*r/49.4%
Simplified49.4%
if -1.3500000000000001e121 < z < 2.8999999999999998e227Initial program 98.5%
Taylor expanded in t around inf 63.0%
+-commutative63.0%
Simplified63.0%
Final simplification60.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.35e+121) (* (/ y t) (- z)) (if (<= z 1.7e+225) (+ x y) (* y (/ (- z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+121) {
tmp = (y / t) * -z;
} else if (z <= 1.7e+225) {
tmp = x + y;
} else {
tmp = y * (-z / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.35d+121)) then
tmp = (y / t) * -z
else if (z <= 1.7d+225) then
tmp = x + y
else
tmp = y * (-z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+121) {
tmp = (y / t) * -z;
} else if (z <= 1.7e+225) {
tmp = x + y;
} else {
tmp = y * (-z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.35e+121: tmp = (y / t) * -z elif z <= 1.7e+225: tmp = x + y else: tmp = y * (-z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e+121) tmp = Float64(Float64(y / t) * Float64(-z)); elseif (z <= 1.7e+225) tmp = Float64(x + y); else tmp = Float64(y * Float64(Float64(-z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.35e+121) tmp = (y / t) * -z; elseif (z <= 1.7e+225) tmp = x + y; else tmp = y * (-z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e+121], N[(N[(y / t), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[z, 1.7e+225], N[(x + y), $MachinePrecision], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+121}:\\
\;\;\;\;\frac{y}{t} \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+225}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\end{array}
\end{array}
if z < -1.3500000000000001e121Initial program 94.7%
clear-num94.7%
un-div-inv94.8%
Applied egg-rr94.8%
Taylor expanded in a around 0 49.0%
mul-1-neg49.0%
unsub-neg49.0%
associate-/l*56.8%
div-sub56.8%
*-inverses56.8%
Simplified56.8%
Taylor expanded in z around inf 40.5%
mul-1-neg40.5%
distribute-neg-frac40.5%
*-commutative40.5%
distribute-rgt-neg-in40.5%
associate-*r/40.5%
Simplified40.5%
if -1.3500000000000001e121 < z < 1.70000000000000009e225Initial program 98.5%
Taylor expanded in t around inf 63.0%
+-commutative63.0%
Simplified63.0%
if 1.70000000000000009e225 < z Initial program 99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 72.6%
mul-1-neg72.6%
unsub-neg72.6%
associate-/l*72.5%
div-sub72.5%
*-inverses72.5%
Simplified72.5%
Taylor expanded in z around inf 67.4%
mul-1-neg67.4%
distribute-neg-frac267.4%
associate-*r/67.3%
Simplified67.3%
Final simplification60.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -7.2e+95) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.2e+95) {
tmp = x;
} 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 (a <= (-7.2d+95)) then
tmp = x
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 (a <= -7.2e+95) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.2e+95: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.2e+95) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -7.2e+95) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.2e+95], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{+95}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -7.19999999999999955e95Initial program 97.7%
Taylor expanded in x around inf 61.1%
if -7.19999999999999955e95 < a Initial program 98.2%
Taylor expanded in t around inf 55.2%
+-commutative55.2%
Simplified55.2%
Final simplification56.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.7e+268) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.7e+268) {
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 (t <= 1.7d+268) 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 (t <= 1.7e+268) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.7e+268: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.7e+268) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.7e+268) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.7e+268], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.7 \cdot 10^{+268}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if t < 1.7000000000000001e268Initial program 98.0%
Taylor expanded in x around inf 47.1%
if 1.7000000000000001e268 < t Initial program 100.0%
Taylor expanded in t around inf 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
(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 98.1%
Taylor expanded in x around inf 46.1%
(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 2024185
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))
(+ x (* y (/ (- z t) (- a t)))))