
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 80.8%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.2
Applied egg-rr99.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.06e-106) (fma (/ (- t z) t) y x) (if (<= t 2.9e+24) (fma (- z t) (/ y a) x) (fma y (- 1.0 (/ z t)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.06e-106) {
tmp = fma(((t - z) / t), y, x);
} else if (t <= 2.9e+24) {
tmp = fma((z - t), (y / a), x);
} else {
tmp = fma(y, (1.0 - (z / t)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.06e-106) tmp = fma(Float64(Float64(t - z) / t), y, x); elseif (t <= 2.9e+24) tmp = fma(Float64(z - t), Float64(y / a), x); else tmp = fma(y, Float64(1.0 - Float64(z / t)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.06e-106], N[(N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t, 2.9e+24], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.06 \cdot 10^{-106}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{t}, y, x\right)\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\end{array}
\end{array}
if t < -1.06e-106Initial program 75.4%
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.0
Applied egg-rr99.0%
Taylor expanded in a around 0
mul-1-negN/A
neg-lowering-neg.f6485.8
Simplified85.8%
if -1.06e-106 < t < 2.89999999999999979e24Initial program 92.6%
Taylor expanded in a around inf
Simplified81.3%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f6484.8
Applied egg-rr84.8%
if 2.89999999999999979e24 < t Initial program 69.7%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6490.0
Simplified90.0%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (- 1.0 (/ z t)) x))) (if (<= t -9.5e-107) t_1 (if (<= t 2e+24) (fma (- z t) (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (1.0 - (z / t)), x);
double tmp;
if (t <= -9.5e-107) {
tmp = t_1;
} else if (t <= 2e+24) {
tmp = fma((z - t), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(1.0 - Float64(z / t)), x) tmp = 0.0 if (t <= -9.5e-107) tmp = t_1; elseif (t <= 2e+24) tmp = fma(Float64(z - t), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -9.5e-107], t$95$1, If[LessEqual[t, 2e+24], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{-107}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.4999999999999999e-107 or 2e24 < t Initial program 73.0%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6487.6
Simplified87.6%
if -9.4999999999999999e-107 < t < 2e24Initial program 92.6%
Taylor expanded in a around inf
Simplified81.3%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f6484.8
Applied egg-rr84.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (- 1.0 (/ z t)) x))) (if (<= t -1.08e-106) t_1 (if (<= t 6e+23) (fma y (/ (- z t) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (1.0 - (z / t)), x);
double tmp;
if (t <= -1.08e-106) {
tmp = t_1;
} else if (t <= 6e+23) {
tmp = fma(y, ((z - t) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(1.0 - Float64(z / t)), x) tmp = 0.0 if (t <= -1.08e-106) tmp = t_1; elseif (t <= 6e+23) tmp = fma(y, Float64(Float64(z - t) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -1.08e-106], t$95$1, If[LessEqual[t, 6e+23], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{if}\;t \leq -1.08 \cdot 10^{-106}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.08e-106 or 6.0000000000000002e23 < t Initial program 73.0%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6487.6
Simplified87.6%
if -1.08e-106 < t < 6.0000000000000002e23Initial program 92.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6484.7
Simplified84.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (- 1.0 (/ z t)) x))) (if (<= t -7e-125) t_1 (if (<= t 1.34e+26) (fma z (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (1.0 - (z / t)), x);
double tmp;
if (t <= -7e-125) {
tmp = t_1;
} else if (t <= 1.34e+26) {
tmp = fma(z, (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(1.0 - Float64(z / t)), x) tmp = 0.0 if (t <= -7e-125) tmp = t_1; elseif (t <= 1.34e+26) tmp = fma(z, Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -7e-125], t$95$1, If[LessEqual[t, 1.34e+26], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{if}\;t \leq -7 \cdot 10^{-125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.34 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.99999999999999995e-125 or 1.34000000000000007e26 < t Initial program 74.0%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6486.2
Simplified86.2%
if -6.99999999999999995e-125 < t < 1.34000000000000007e26Initial program 92.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6477.5
Simplified77.5%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6482.2
Applied egg-rr82.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.6e-118) (+ x y) (if (<= t 6500000000000.0) (fma z (/ y a) x) (+ x (fma a (/ y t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.6e-118) {
tmp = x + y;
} else if (t <= 6500000000000.0) {
tmp = fma(z, (y / a), x);
} else {
tmp = x + fma(a, (y / t), y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.6e-118) tmp = Float64(x + y); elseif (t <= 6500000000000.0) tmp = fma(z, Float64(y / a), x); else tmp = Float64(x + fma(a, Float64(y / t), y)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.6e-118], N[(x + y), $MachinePrecision], If[LessEqual[t, 6500000000000.0], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(a * N[(y / t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-118}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 6500000000000:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(a, \frac{y}{t}, y\right)\\
\end{array}
\end{array}
if t < -1.60000000000000002e-118Initial program 76.9%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6470.3
Simplified70.3%
if -1.60000000000000002e-118 < t < 6.5e12Initial program 91.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6477.8
Simplified77.8%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6482.6
Applied egg-rr82.6%
if 6.5e12 < t Initial program 71.0%
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6482.6
Simplified82.6%
Taylor expanded in t around inf
+-lowering-+.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6477.7
Simplified77.7%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.45e-118) (+ x y) (if (<= t 86000000000000.0) (fma z (/ y a) x) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.45e-118) {
tmp = x + y;
} else if (t <= 86000000000000.0) {
tmp = fma(z, (y / a), x);
} else {
tmp = x + y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.45e-118) tmp = Float64(x + y); elseif (t <= 86000000000000.0) tmp = fma(z, Float64(y / a), x); else tmp = Float64(x + y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.45e-118], N[(x + y), $MachinePrecision], If[LessEqual[t, 86000000000000.0], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-118}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 86000000000000:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.4499999999999999e-118 or 8.6e13 < t Initial program 74.5%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6473.4
Simplified73.4%
if -1.4499999999999999e-118 < t < 8.6e13Initial program 91.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6477.8
Simplified77.8%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6482.6
Applied egg-rr82.6%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.6e-118) (+ x y) (if (<= t 2.5e+14) (fma y (/ z a) x) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.6e-118) {
tmp = x + y;
} else if (t <= 2.5e+14) {
tmp = fma(y, (z / a), x);
} else {
tmp = x + y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.6e-118) tmp = Float64(x + y); elseif (t <= 2.5e+14) tmp = fma(y, Float64(z / a), x); else tmp = Float64(x + y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.6e-118], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.5e+14], N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-118}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+14}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.60000000000000002e-118 or 2.5e14 < t Initial program 74.5%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6473.4
Simplified73.4%
if -1.60000000000000002e-118 < t < 2.5e14Initial program 91.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6482.5
Simplified82.5%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (fma (/ (- z t) (- a t)) y x))
double code(double x, double y, double z, double t, double a) {
return fma(((z - t) / (a - t)), y, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(z - t) / Float64(a - t)), y, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{z - t}{a - t}, y, x\right)
\end{array}
Initial program 80.8%
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.8
Applied egg-rr98.8%
(FPCore (x y z t a) :precision binary64 (fma (/ y (- a t)) (- z t) x))
double code(double x, double y, double z, double t, double a) {
return fma((y / (a - t)), (z - t), x);
}
function code(x, y, z, t, a) return fma(Float64(y / Float64(a - t)), Float64(z - t), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)
\end{array}
Initial program 80.8%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.9
Applied egg-rr96.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -7.5e+118) y (if (<= y 2.6e+152) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -7.5e+118) {
tmp = y;
} else if (y <= 2.6e+152) {
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 <= (-7.5d+118)) then
tmp = y
else if (y <= 2.6d+152) 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 <= -7.5e+118) {
tmp = y;
} else if (y <= 2.6e+152) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -7.5e+118: tmp = y elif y <= 2.6e+152: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -7.5e+118) tmp = y; elseif (y <= 2.6e+152) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -7.5e+118) tmp = y; elseif (y <= 2.6e+152) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -7.5e+118], y, If[LessEqual[y, 2.6e+152], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+118}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+152}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -7.50000000000000003e118 or 2.6000000000000001e152 < y Initial program 50.4%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6447.6
Simplified47.6%
Taylor expanded in y around inf
Simplified40.5%
if -7.50000000000000003e118 < y < 2.6000000000000001e152Initial program 93.9%
Taylor expanded in x around inf
Simplified62.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.15e+207) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.15e+207) {
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 <= (-1.15d+207)) 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 <= -1.15e+207) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.15e+207: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.15e+207) 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 <= -1.15e+207) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.15e+207], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.15 \cdot 10^{+207}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.14999999999999997e207Initial program 69.2%
Taylor expanded in x around inf
Simplified82.6%
if -1.14999999999999997e207 < a Initial program 81.9%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6464.4
Simplified64.4%
Final simplification65.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 80.8%
Taylor expanded in x around inf
Simplified46.9%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024204
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))