
(FPCore (f) :precision binary64 (let* ((t_0 (* (/ PI 4.0) f)) (t_1 (exp t_0)) (t_2 (exp (- t_0)))) (- (* (/ 1.0 (/ PI 4.0)) (log (/ (+ t_1 t_2) (- t_1 t_2)))))))
double code(double f) {
double t_0 = (((double) M_PI) / 4.0) * f;
double t_1 = exp(t_0);
double t_2 = exp(-t_0);
return -((1.0 / (((double) M_PI) / 4.0)) * log(((t_1 + t_2) / (t_1 - t_2))));
}
public static double code(double f) {
double t_0 = (Math.PI / 4.0) * f;
double t_1 = Math.exp(t_0);
double t_2 = Math.exp(-t_0);
return -((1.0 / (Math.PI / 4.0)) * Math.log(((t_1 + t_2) / (t_1 - t_2))));
}
def code(f): t_0 = (math.pi / 4.0) * f t_1 = math.exp(t_0) t_2 = math.exp(-t_0) return -((1.0 / (math.pi / 4.0)) * math.log(((t_1 + t_2) / (t_1 - t_2))))
function code(f) t_0 = Float64(Float64(pi / 4.0) * f) t_1 = exp(t_0) t_2 = exp(Float64(-t_0)) return Float64(-Float64(Float64(1.0 / Float64(pi / 4.0)) * log(Float64(Float64(t_1 + t_2) / Float64(t_1 - t_2))))) end
function tmp = code(f) t_0 = (pi / 4.0) * f; t_1 = exp(t_0); t_2 = exp(-t_0); tmp = -((1.0 / (pi / 4.0)) * log(((t_1 + t_2) / (t_1 - t_2)))); end
code[f_] := Block[{t$95$0 = N[(N[(Pi / 4.0), $MachinePrecision] * f), $MachinePrecision]}, Block[{t$95$1 = N[Exp[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Exp[(-t$95$0)], $MachinePrecision]}, (-N[(N[(1.0 / N[(Pi / 4.0), $MachinePrecision]), $MachinePrecision] * N[Log[N[(N[(t$95$1 + t$95$2), $MachinePrecision] / N[(t$95$1 - t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\pi}{4} \cdot f\\
t_1 := e^{t\_0}\\
t_2 := e^{-t\_0}\\
-\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{t\_1 + t\_2}{t\_1 - t\_2}\right)
\end{array}
\end{array}
herbie shell --seed 2025126
(FPCore (f)
:name "VandenBroeck and Keller, Equation (20)"
:precision binary64
(- (* (/ 1.0 (/ PI 4.0)) (log (/ (+ (exp (* (/ PI 4.0) f)) (exp (- (* (/ PI 4.0) f)))) (- (exp (* (/ PI 4.0) f)) (exp (- (* (/ PI 4.0) f)))))))))
Please file a bug report with this information.
| map: contract violation expected: list? given: "(let (v_0 (/.f64 PI.f64 4)) (let (v_1 (*.f64 v_0 $var0)) (let (v_2 (exp.f64 v_1)) (let (v_3 (exp.f64 (neg.f64 v_1))) (let (v_4 (/.f64 1 v_0)) (let (v_5 (log.f64 (/.f64 (+.f64 v_2 v_3) (-.f64 v_2 v_3))))... | L | C | |
|---|---|---|---|
| gen-map | /usr/share/racket/collects/racket/private/map.rkt | 257 | 2 |
| add-derivations-to | /home/nightlies/herbie/artem-rules-updates/src/core/derivations.rkt | 16 | 0 |
| hash-ref! | /usr/share/racket/collects/racket/private/more-scheme.rkt | 377 | 2 |
| loop | .../private/map.rkt | 40 | 19 |
| alt-map | /home/nightlies/herbie/artem-rules-updates/src/utils/alternative.rkt | 43 | 0 |
| loop | .../private/map.rkt | 40 | 19 |
| alt-map | /home/nightlies/herbie/artem-rules-updates/src/utils/alternative.rkt | 43 | 0 |
| add-derivations | /home/nightlies/herbie/artem-rules-updates/src/core/derivations.rkt | 30 | 0 |
| extract! | /home/nightlies/herbie/artem-rules-updates/src/core/mainloop.rkt | 60 | 0 |
| run-improve! | /home/nightlies/herbie/artem-rules-updates/src/core/mainloop.rkt | 40 | 0 |
| get-alternatives | /home/nightlies/herbie/artem-rules-updates/src/api/sandbox.rkt | 61 | 0 |
| (unnamed) | /home/nightlies/herbie/artem-rules-updates/src/api/sandbox.rkt | 191 | 6 |
| (unnamed) | /usr/share/racket/pkgs/profile-lib/main.rkt | 40 | 10 |
| profile-thunk | /usr/share/racket/pkgs/profile-lib/main.rkt | 9 | 0 |
| in-engine | /home/nightlies/herbie/artem-rules-updates/src/api/sandbox.rkt | 207 | 2 |
| (unnamed) | /usr/share/racket/collects/racket/engine.rkt | 42 | 24 |